我正在尝试使用Ebay提供的大型商家服务API将文件上传到ebay上.
他们提供了相同的sample.jar文件.当我们在命令提示符下执行.jar文件时似乎工作正常,但是当我尝试将其源代码集成到我的Web应用程序中时,它给了我这个错误.此外,我尝试使用netbeans创建一个Web服务客户端并尝试使用它,但它仍然给了我同样的错误.我还将SOAP版本从1.1更改为1.2,但这似乎也不起作用.以下是完整的堆栈跟踪.
Nov 11, 2011 2:59:41 PM com.sun.xml.internal.messaging.saaj.soap.MessageImpl init
SEVERE: SAAJ0533: Cannot create message: incorrect content-type for SOAP version. Got text/xml; charset=UTF-8, but expected application/soap+xml
Nov 11, 2011 2:59:41 PM com.sun.xml.internal.messaging.saaj.soap.MessageImpl init
SEVERE: SAAJ0535: Unable to internalize message
Exception in thread "main" javax.xml.ws.WebServiceException: Couldn't create SOAP message due to exception: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPConnectionUtil.java:83)
at com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMessage(SOAPXMLDecoder.java:102)
at com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:440)
at com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:260)
at com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:139)
at com.sun.xml.internal.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:86)
at com.sun.xml.internal.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:174)
at com.sun.xml.internal.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:108)
at $Proxy28.createUploadJob(Unknown Source)
at com.SwiftConnectV1.fileprocess.LMS.BulkDataExchangeActions.createUploadJob(BulkDataExchangeActions.java:138)
at com.SwiftConnectV1.fileprocess.LMS.LMSClientJobs.createUploadJob(LMSClientJobs.java:154)
at com.SwiftConnectV1.fileprocess.LMS.LMSSample.main(LMSSample.java:74) …
Run Code Online (Sandbox Code Playgroud) 我在我的AddFixedPriceItem请求中指定了一个SKU,但响应没有带回SKU(尽管在模式中指定了SKU).这是一个问题,因为我使用大型商家服务,可以一次提交多个项目.如果一个批次中的一个项目失败,我该如何判断它是哪一个?如何将SKU与ItemIds相关联?如果我无法将其映射回我的库存中的某些内容,则响应信息的价值非常小.
以下是不返回SKU的请求的示例:
<?xml version="1.0" encoding="UTF-8"?>
<BulkDataExchangeRequests xmlns="urn:ebay:apis:eBLBaseComponents">
<Header>
<SiteID>0</SiteID>
<Version>639</Version>
</Header>
<AddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<Version>639</Version>
<Item>
<CategoryMappingAllowed>true</CategoryMappingAllowed>
<Country>US</Country>
<Currency>USD</Currency>
<Description>This is the description.</Description>
<ListingDuration>GTC</ListingDuration>
<ListingType>FixedPriceItem</ListingType>
<Location>Provo, UT</Location>
<PaymentMethods>PayPal</PaymentMethods>
<PayPalEmailAddress>ebay@mystore.com</PayPalEmailAddress>
<PrimaryCategory>
<CategoryID>63850</CategoryID>
</PrimaryCategory>
<Quantity>10</Quantity>
<ShippingDetails>
<SalesTax>
<SalesTaxPercent>6.5</SalesTaxPercent>
<SalesTaxState>UT</SalesTaxState>
<ShippingIncludedInTax>false</ShippingIncludedInTax>
</SalesTax>
<ShippingServiceOptions>
<ShippingService>UPSGround</ShippingService>
<ShippingServiceCost currencyID="USD">7.99</ShippingServiceCost>
<ShippingServiceAdditionalCost currencyID="USD">0.0</ShippingServiceAdditionalCost>
<ShippingServicePriority>1</ShippingServicePriority>
</ShippingServiceOptions>
<ShippingType>Flat</ShippingType>
<InsuranceDetails>
<InsuranceOption>NotOffered</InsuranceOption>
</InsuranceDetails>
</ShippingDetails>
<Site>US</Site>
<StartPrice currencyID="USD">100.0</StartPrice>
<Title>Test Product</Title>
<SKU>PROD02-TST</SKU>
<DispatchTimeMax>3</DispatchTimeMax>
<ReturnPolicy>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<Description>Our return policy details.</Description>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
<InventoryTrackingMethod>ItemID</InventoryTrackingMethod>
</Item>
</AddFixedPriceItemRequest>
</BulkDataExchangeRequests>
Run Code Online (Sandbox Code Playgroud)