For full functionality of this site it is necessary to enable JavaScript.
Here are the instructions how to enable JavaScript in your web browser.

Knowledge base

Find the answer to your question

Advanced Search PView

Search terms
Search Type
Product
Category
Language
Format
SDK
Sort by
Direction

LMS FileTransferService APIs time out with Java SOAP client

  • Answer ID 1379
  • Published 03/12/2009 10:12 PM
  • Updated 10/20/2013 06:41 AM
  • Permalink https://ebaydts.com/eBayKBDetails?KBid=1379

I am getting java.net.SocketTimeoutException when using Java web service to make LMS FileTransferService SOAP calls, how to fix the issue?


Summary    

    Some Java SOAP engines like Axis2 or Apache CXF web service sets by default in Chunk mode, meaning it sends http data in chunk format. However;  eBay LMS API Web Service does not support 'Transfer-Encoding: chunked' http message-header and  returns an error. As a result, the client stub should be set in Non-Chunk mode with this line inside the upload and download method: testStub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);

   If your ServiceClient class extends com.ebay.www.marketplace.services.FileTransferServiceStub.UploadFileResponseE the generated Stub class,  the ServiceClient.downloadFile implementation should be:

 public static boolean downloadFile(String fileSaveToPath, String task_ref_id, String file_ref_id) throws AxisFault, RemoteException, Exception {

     String authToken=LMSProperties.getInstance().getAuthToken();
     String endPointURL=LMSProperties.getInstance().getFtsEndPointURL();
     ServiceClient testStub = new ServiceClient(endPointURL);
     testStub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
     testStub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
     testStub._getServiceClient().getOptions().setTimeOutInMilliSeconds(
     LMSProperties.getInstance().getTimeOutInMilliSeconds());
  …

}



How well did this answer your question?

Answers others found helpful

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter