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: {}Envelope but found: {urn:ebay:apis:eBLBaseComponents}GeteBayOfficialTimeResponse

at com.ebay.sdk.ApiCall.executeByApiName(
at com.ebay.sdk.ApiCall.execute(

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  ( 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("")
Production: apiContext.setApiServerUrl("") 

Additional Resources


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