Customer Portal

webservice client error

Comments 4

  • Avatar
    admin
    0
    Comment actions Permalink
    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
  • Avatar
    noob27
    0
    Comment actions Permalink
    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.
  • Avatar
    admin
    0
    Comment actions Permalink
    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
  • Avatar
    admin
    0
    Comment actions Permalink
    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.

Please sign in to leave a comment.