03-60-569 project

38
1 03-60-569 Project Global Book retailer Titas Mutsuddy Quazi Rahman

Upload: kalkin

Post on 13-Jan-2016

37 views

Category:

Documents


0 download

DESCRIPTION

03-60-569 Project. Global Book retailer Titas Mutsuddy Quazi Rahman. Outline. Introduction. Service integration. Screen shots of project. Difficulties faced. Conclusion. Introduction. Project Description: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 03-60-569 Project

1

03-60-569 Project

Global Book retailer

Titas Mutsuddy

Quazi Rahman

Page 2: 03-60-569 Project

2

Outline

Introduction. Service integration. Screen shots of project. Difficulties faced. Conclusion.

Page 3: 03-60-569 Project

3

Introduction

Project Description:

Integration of Amazon web service, eBay web service to find out cheap books and convert price to other currencies.

Page 4: 03-60-569 Project

4

Web services

Amazon Web Service. eBay Web service. Currency Converter (XMathods).

Page 5: 03-60-569 Project

5

Tools used

Axis 1.4 (switched from Axis2). WSDL2Java JAX-RPC

Tomcat 5.5 J2sdk1.5

Jsp Servlet Java Bean

Page 6: 03-60-569 Project

6

Class Diagram

Page 7: 03-60-569 Project

7

Screen Shots

Page 8: 03-60-569 Project

8

Screen Shots

Page 9: 03-60-569 Project

9

Screen Shots

Page 10: 03-60-569 Project

10

Screen Shots

Page 11: 03-60-569 Project

11

Screen Shots

Page 12: 03-60-569 Project

12

Screen Shots

Page 13: 03-60-569 Project

13

Screen Shots

Page 14: 03-60-569 Project

14

Screen Shots

Page 15: 03-60-569 Project

15

Screen shots

Page 16: 03-60-569 Project

16

Screen Shots

Page 17: 03-60-569 Project

17

Screen Shots

Page 18: 03-60-569 Project

18

Difficulties faced

Installation of Axis(2.0/1.4). Class path setup. Set up jar files in to lib.

Amazon web service call. Set up keys for service call. Soap message call.

Page 19: 03-60-569 Project

19

Difficulties faced

eBay web service call:Soap API .eBay Java SDK (XML based RPC).

System development:SandBox development environment.Production development environment.

Page 20: 03-60-569 Project

20

Difficulties faced

Difficulties with eBay:- eBay active auction is so volatile that most of the time auction

ended before debugging of codes. eBay API manual is not friendly for new developers. eBay uses their own “ItemID” for each item in active auction. I Failed Item Specific search in eBay. Succeeded on category

search. Parsed whole category response xml to pick up item by “Title”. Most of the time Amazon and eBay book title are not same. Tried to find out possible pattern to split the titles to extract the

name.

Page 21: 03-60-569 Project

21

Difficulties faced

eBay web service:- Authentication failure:

<?xml version="1.0" encoding="UTF-8"?>

<eBay><EBayTime>2007-03-10 15:46:37</EBayTime><Errors><Error><Code>16112</Code>

<SeverityCode>1</SeverityCode>

<Severity>SeriousError</Severity>

<Line>0</Line><Column>0</Column>

<ErrorClass>RequestError</ErrorClass>

<ShortMessage><![CDATA[Invalid authentication method.]]></ShortMessage><LongMessage><![CDATA[The authentication method you are using is invalid. Please use the eBay Authentication & Authorization method.]]></LongMessage></Error></Errors></eBay>

Page 22: 03-60-569 Project

22

Difficulties faced

eBay web service

“The velocity (rate of change) of eBay is notoriously fast. As anyone who has used eBay knows, things constantly change, and there is a fundamental release every 2 weeks. There are supporters and non-supporters of this, but it's something we all have to live with at this time, both eBay users and eBay employees…..”

Best Regards,Amish PateleBay Developer Support

Page 23: 03-60-569 Project

23

Difficulties faced

GetItemRequest fails

<?xml version="1.0" encoding="utf-8"?>

<GetItemRequest xmlns="urn:ebay:apis:eBLBaseComponents"> <DetailLevel>ItemReturnAttributes</DetailLevel> <RequesterCredentials>

<eBayAuthToken>MY TOKEN </eBayAuthToken> </RequesterCredentials>

<ItemID>517203014</ItemID>

</GetItemRequest>

Page 24: 03-60-569 Project

24

Difficulties faced

<?xml version="1.0" encoding="UTF-8"?>

<GetItemResponse xmlns="urn:ebay:apis:eBLBaseComponents">

<Timestamp>2007-03-12T1 7:17:47.171Z</Timestamp>

<Ack>Failure</Ack>

<Errors>

<ShortMessage>Item not found.</ShortMessage>

<LongMessage>Item &quot;517203014&quot; is invalid, not activated,or no longer in our database, or an Live Auction item.</LongMessage>

<ErrorCode>17</ErrorCode>

<SeverityCode>Error</SeverityCode>

<ErrorParameters ParamID="0">

<Value>517203014</Value>

</ErrorParameters>

<ErrorClassification>RequestError</ErrorClassification>

</Errors>

<Version>503</Version><Build>e503_core_Bundled_4329350_R1</Build>

</GetItemResponse>

Page 25: 03-60-569 Project

25

Difficulties faced

[email protected]

Posts: 938 Member Since: 10/20/05

Re: GetItemRequest fails Posted: Mar 14, 2007 4:40 PM  Reply

Hi titasmutsuddy,

You need to specify an eBay ItemID but ISBN # in your GetItem API request. You can get the item number in either your item's View Item or the seller's My eBay Selling page.

Best Regards,Zhuowei YangeBay Developer Support

Page 26: 03-60-569 Project

26

Difficulties faced

<?xml version="1.0" encoding="UTF-8"?><GetItemResponse xmlns="urn:ebay:apis:eBLBaseComponents">

<Timestamp>2007-03-14T0 3:22:17.302Z</Timestamp><Ack>Failure</Ack><Errors>

<ShortMessage>Item not found.</ShortMessage> <LongMessage>Item &quot;130094932808&quot; is invalid, not

activated, or no longer in our database, or an Live Auction item.</LongMessage> <ErrorCode>17</ErrorCode>

<SeverityCode>Error</SeverityCode> <ErrorParameters ParamID="0"> <Value>130094932808</Value> </ErrorParameters> <ErrorClassification>RequestError</ErrorClassification> </Errors> <Version>503</Version> <Build>e503_core_Bundled_4329350_R1</Build></GetItemResponse>

Page 27: 03-60-569 Project

27

Difficulties faced

GetSearchResultRequest:-

<?xml version='1.0' encoding='utf-8'?>\r\n"+<GetSearchResultsRequest xmlns=\"urn:ebay:apis:eBLBaseComponents\">

<ExternalProductID> <Value>0876295340</Value>

<Type>ISBN</Type> </ExternalProductID> <Pagination> <EntriesPerPage>2</EntriesPerPage> <PageNumber>1</PageNumber> </Pagination> <RequesterCredentials> <eBayAuthToken>token</eBayAuthToken> </RequesterCredentials>

</GetSearchResultsRequest>

Page 28: 03-60-569 Project

28

Difficulties faced

GetSearchResultResponse:-

<?xml version="1.0" encoding="UTF-8"?><GetSearchResultsResponse

xmlns="urn:ebay:apis:eBLBaseComponents"><Timestamp>2007-03-14T19:13:08.706Z</Timestamp><Ack>Success</Ack><Version>503</Version><Build>e503_core_Bundled_4329350_R1</Build><ItemsPerPage>100</ItemsPerPage><PageNumber>1</PageNumber><HasMoreItems>false</HasMoreItems><PaginationResult><TotalNumberOfPages>1</TotalNumberOfPages><TotalNumberOfEntries>0</TotalNumberOfEntries></PaginationResult><CategoryArray/></GetSearchResultsResponse>

Page 29: 03-60-569 Project

29

Difficulties faced

Error:- Content not allowed in prolog

[Fatal Error] request.xml:1:41: Content is not allowed in prolog.

Error Sending Request: org.xml.sax.SAXParseException: Content is not allowed in

prolog.

org.xml.sax.SAXParseException: Content is not allowed in prolog.

at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)

at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:172)

at GetSearchResults.SendRequest(GetSearchResults.java:220)

at GetSearchResults.main(GetSearchResults.java:91)

Page 30: 03-60-569 Project

30

Difficulties faced

Page 31: 03-60-569 Project

31

Difficulties faced

titasmutsuddy

Posts: 4 Member Since: 3/13/07

PKIX path building failed Posted: Mar 14, 2007 9:38 PM   Reply Hi,

I am getting a strange error. I didn't get it 4-hours ago. It is like the following:-

SendRequest IO Error:javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150)at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1518)at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168)and so on------

Note that I am using the jre1.5.0_11 and checked for latest version and there is none.

I will be pleased if you give any suggestions.

Regards,Titas Mutsuddy

Page 32: 03-60-569 Project

32

Difficulties faced

Response:-

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed

I think Sun changed the default TrustManagerFactory from SunX509 to SunPKIX sometime during the 1.5.0 update cycle. grep ManagerFactory $JAVA_HOME/jre/lib/security/java.security You should be able to override these with system properties.

Page 33: 03-60-569 Project

33

Difficulties faced

Default:-

ssl.KeyManagerFactory.algorithm=SunX509

ssl.TrustManagerFactory.algorithm=PKIX

OverWritten in the following properties file:- D:\Sun\AppServer\jdk\jre\lib\security\java.security(properties file):-

ssl.KeyManagerFactory.algorithm=PKIX

ssl.TrustManagerFactory.algorithm=PKIX

Page 34: 03-60-569 Project

34

Difficulties faced

caradtester

Posts: 1 Member Since: 3/10/06

Re: PKIX path building failed Posted: Mar 14, 2007 11:48 PM   Reply Your JDK is probably missing one of the CA-certs in the path for https://api.sandbox.ebay.com

It seems sandbox may have updated the SSL certificate within the last 24 hours. Hopefully there will be an official update soon.

Meanwhile.... you might try this (assuming windows platform):

1. In IE, connect to https://api.sandbox.ebay.com2. Go to Tools > Internet Options > Content > Certificates > Intermediate Certification Authorities [or "Trusted Root Certification Authorities"]3. Choose "VeriSign Class 3 Secure Server CA" (I assume this is the certificate that is missing... you can confirm by comparing thumbprints to what is in your keystore)4. Click "Export...", then "Next>"5. Select "DER encoded binary X.509 (.CER)"6. Name the file c:\temp\verisignsecureserver.cer7. Select "Finish"8. \j2sdk1.4.2_08\bin\keytool -keystore \j2sdk1.4.2_08\jre\lib\security\cacerts -import -alias verisignsecureserver -file c:\temp\verisignsecureserver.cer -trustcacerts9. del c:\temp\verisignsecureserver.cer

Note that you must have a full JDK installed (not just the JRE) to have access. The default password for the JDK keystore is well-known: changeit

Please post feedback if this worked for you or not.

Page 35: 03-60-569 Project

35

Difficulties faced

GetSearchResultRequest (Category search succeeded):-

<?xml version='1.0' encoding='utf-8'?> < GetSearchResultRequest xmlns="urn:ebay:apis:eBLBaseComponents"> <RequesterCredentials>

<eBayAuthToken>token </eBayAuthToken></RequesterCredentials>

<ErrorLevel>1</ErrorLevel><Query>books</Query><MaxResults>2</MaxResults><SiteId>0</SiteId>

</GetSearchResultRequest>

Page 36: 03-60-569 Project

36

Conclusion

Rate of change of eBay is notoriously fast. Failed “Item specific” search in eBay web service. eBay XML based Java API is difficult to handle. eBay introduced SOAP based API in mid-2004 and still eBay platform is

undergoing significant transition to SOAP.

Page 37: 03-60-569 Project

37

Future extension

Item wise search for eBay. Integrate other available book retailers web service. Try to create the Shopping Cart (Most difficult part of the project).

Page 38: 03-60-569 Project

38

Questions ?