1
我需要通過eBay API標記eBay訂單。如何將Ebay訂單標記爲已發貨。 API
有一個方法:
public void ShippEbayOrder(EbayOrder ebayOrder)
{
string Developer = WebConfigurationManager.AppSettings["EbayProductionDevID"];
string Application = WebConfigurationManager.AppSettings["EbayProductionAppID"];
string Certificate = WebConfigurationManager.AppSettings["EbayProductionCertID"];
string eBayToken = WebConfigurationManager.AppSettings["EbayProductionUserToken"];
string SoapApiServerUrl = WebConfigurationManager.AppSettings["EbayProductionApiServerUrl"];
string SignInUrl = WebConfigurationManager.AppSettings["EbayProductionSignInUrl"];
string EPSServerUrl = WebConfigurationManager.AppSettings["EbayProductionEPSUrl"];
var ebayService = GetebayService();
CompleteSaleRequestType completeSaleRequestType = new CompleteSaleRequestType();
completeSaleRequestType.Version = version;
if (ebayOrder.ContainsOrderType == EbayOrder.OrderType.Transaction)
{
completeSaleRequestType.TransactionID = ebayOrder.SourceOrderId;
completeSaleRequestType.ItemID = ebayOrder.ItemsInfo[0].SourceItemId;
}
else
completeSaleRequestType.OrderID = ebayOrder.SourceOrderId;
completeSaleRequestType.Shipped = true;
completeSaleRequestType.ShippedSpecified = true;
CompleteSaleResponseType completeSaleResponseType = ebayService.CompleteSale(completeSaleRequestType);
但是,當代碼調用CompleteSale方法,它拋出一個exeption:
java.lang.ClassCastException: com.ebay.domain.apisoap.pres.service.hosting.soap.basecomponents.GetSellerTransactionsResponseType incompatible with com.ebay.domain.apisoap.pres.service.hosting.soap.basecomponents.CompleteSaleResponseType
誰能幫我?謝謝!
什麼'ebayService.CompleteSale'回報,因爲它顯然不是一個'CompleteSaleResponseType'我們需要更多的信息。 – 2012-07-30 13:14:17
它返回CompleteSaleResponseType對象 – ihorko 2012-07-30 13:33:25