Skip to main content
Published: April 05 2012, 12:25:00 PMUpdated: August 24 2022, 9:46:36 PM

  I am getting the following exception when making Trading API calls using eBay Java SDK . What is the problem?

 com.ebay.sdk.SdkException: ApiCall.execute() - Couldn't create SOAP message due to exception: unexpected XML tag. expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {urn:ebay:apis:eBLBaseComponents}GeteBayOfficialTimeResponse

at com.ebay.sdk.ApiCall.executeByApiName(ApiCall.java:592)
at com.ebay.sdk.ApiCall.execute(ApiCall.java:349)
at com.ebay.sdk.call.GeteBayOfficialTimeCall.geteBayOfficialTime(GeteBayOfficialTimeCall.java:64)
at com.me.ApplicationHelloWorld.main(ApplicationHelloWorld.java:50)

Detailed Description

  The Couldn't create SOAP message due to exception: unexpected XML error thrown in Java SDK indicates that you used the XML API Gateway URI as https://api.sandbox.ebay.com/ws/api.dll  ( for Sandbox) for your SOAP API calls . 

  To correct the problem, you need to set the SOAP API Gateway URI for  your ApiContext object as below in Java SDK:


                    ApiContext apiContext = new ApiContext();
Sandbox:    apiContext.setApiServerUrl("https://api.sandbox.ebay.com/wsapi")
Production: apiContext.setApiServerUrl("https://api.ebay.com/wsapi") 


Additional Resources

 

How well did this answer your question?
Answers others found helpful

Got thoughts? Click the feedback button – your insights help us improve!