Webservice client error

Hi,

I’m trying to add products to my CA account through their web service but I’m having difficulties in doing it using clover. I tried adding my products through soapui and it went through. I copied the request from soapui and put it in my web service client compenent but it’s not adding the product. Instead I get an error from the server that “No items were specified”. Is clover somehow changing my request structure? Here’s a sample request that worked in soapui and doesn’t work in clover:


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://api.channeladvisor.com/webservices/">
   <soapenv:Header>
      <web:APICredentials>
         <web:DeveloperKey>112233445566778899</web:DeveloperKey>
         <web:Password>test</web:Password>
      </web:APICredentials>
   </soapenv:Header>
   <soapenv:Body>
      <web:SynchInventoryItemList>
         <web:accountID>1125458964634846543549684635465465</web:accountID>
         <web:itemList>
            <web:InventoryItemSubmit>
               <web:Sku>123456789</web:Sku>
               <web:Title>Test Title</web:Title>
               <web:Subtitle>?</web:Subtitle>
               <web:ShortDescription>Short description</web:ShortDescription>
               <web:Description>Description</web:Description>
               <web:Weight>1</web:Weight>
               <web:Manufacturer>Manufacturer</web:Manufacturer>
               <web:Brand>Brand</web:Brand>
               <web:Condition>Condition</web:Condition>
               <web:Warranty>Warranty</web:Warranty>
               <web:Height>1</web:Height>
               <web:Length>1</web:Length>
               <web:Width>1</web:Width>
               <web:QuantityInfo>
                  <web:Total>2</web:Total>
               </web:QuantityInfo>
               <web:PriceInfo>
                  <web:Cost>2</web:Cost>
                  <web:RetailPrice>3</web:RetailPrice>
                  <web:StorePrice>3</web:StorePrice>
               </web:PriceInfo>
               <web:StoreInfo>
                  <web:DisplayInStore>true</web:DisplayInStore>
                  <web:Title>Store title</web:Title>
                  <web:Description>Store Description</web:Description>
               </web:StoreInfo>
            </web:InventoryItemSubmit>
         </web:itemList>
      </web:SynchInventoryItemList>
   </soapenv:Body>
</soapenv:Envelope>

Please help. Thanks in advance.

Hi noob27,

yes, WebServiceClient is enveloping your request. Your request coming by edge should contain just part inside “soapenv:Body”. If you want to send whole request, use HttpConnector.

You can’t genereate headers you need (because are nested) via WebServiceClient component. Workaround can be found here: viewtopic.php?f=6&t=5238&p=8221&hilit=Envelope&sid=117afd7127b321e04ff10d4755a72e19#p8221

Hi Kubosj,

Thanks for the quick response.

That’s what I thought at first that the webservice component might be enveloping my request but I’m confused as to why another method works using the same structure. The request is like this:


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://api.channeladvisor.com/webservices/">
   <soapenv:Header>
      <web:APICredentials>
         <web:DeveloperKey>112233445566778899</web:DeveloperKey>
         <web:Password>test</web:Password>
      </web:APICredentials>
   </soapenv:Header>
   <soapenv:Body>
      <web:Ping/>
   </soapenv:Body>
</soapenv:Envelope>

As you can see it has this <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:web=“http://api.channeladvisor.com/webservices/”> line and its giving me a valid xml response. I also tried using the http component by using this request and all I get is an empty document. My request method is post and my additional http header properties is application/soap+xml.


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://api.channeladvisor.com/webservices/">
   <soap:Header>
      <web:APICredentials>
         <web:DeveloperKey>112233445566778899</web:DeveloperKey>
         <web:Password>test</web:Password>
      </web:APICredentials>
   </soap:Header>
   <soap:Body>
      <web:SynchInventoryItem>
         <web:accountID>1bdc2f3d-94d0-40f1-803b-a44af86d8b9c</web:accountID>
         <web:item>
            <web:Sku>1234567890</web:Sku>
            <web:Title>Title</web:Title>
            <web:Subtitle>Subtitle</web:Subtitle>
            <web:ShortDescription>Short description</web:ShortDescription>
            <web:Description>Description</web:Description>
            <web:Weight>1</web:Weight>
            <web:Height>1</web:Height>
            <web:Length>1</web:Length>
            <web:Width>1</web:Width>
            <web:QuantityInfo>
               <web:Total>2</web:Total>
            </web:QuantityInfo>
            <web:PriceInfo>
               <web:Cost>2</web:Cost>
               <web:RetailPrice>2</web:RetailPrice>
               <web:StorePrice>2</web:StorePrice>
            </web:PriceInfo>
            <web:StoreInfo>
               <web:DisplayInStore>true</web:DisplayInStore>
               <web:Title>Store Title</web:Title>
               <web:Description>Store Description</web:Description>
            </web:StoreInfo>
         </web:item>
      </web:SynchInventoryItem>
   </soap:Body>
</soap:Envelope>

I’m really new at this and I’m lost. Is there a way to configure the DeveloperKey and the Password on the webservice component itself and not on the request structure so that all I’ll have to put on the request structure is the body? For example, would it work if I’d place the DeveloperKey on the username field and the pw on the password field on the advanced section?

Thanks.

Hi noob27,

So you are sure that request content you send to HttpConnector is same as used in soapui? Can you send me graph?

Are you also sure about GET, maybe you can use POST instead? http://www.w3schools.com/soap/soap_httpbinding.asp

addendum:
“SOAP over HTTP works above this underlying protocol. A SOAP request is a POST with an XML body” from http://ws.apache.org/axis/java/client-side-axis.html

We use Apache AXIS in WebServiceClient, so it is using POST.