Forum Moderators: coopster
POST
https://global.marketing.ews.yahooapis.com/services/V4/LocationService
HTTP/1.0
Content-Type: text/xml; charset=utf-8
Content-Length: 987 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://marketing.ews.yahooapis.com/V4">
<soapenv:Header>
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>user</wsse:Username>
<wsse:Password>password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<license>35cf33e7-5ad1-3aa9-0593-346681f64eb0</license>
<masterAccountID>9901672</masterAccountID>
</soapenv:Header>
<soapenv:Body>
<getMasterAccountLocation/>
</soapenv:Body>
</soapenv:Envelope>
Does anyone have any ideas how to set this up, I think the wsse:Security part in the headers is what I just can't seem to get working correctly! Any help, would be much appreciated, thanks for helping me out, I truly appreciate this, I've been stuck for so long and tried to search before posting!
If someone could help me with the PHP syntax for forming the correct NuSoap Request, I'd be in debt to you!
Note that the endpoint, which is the first parameter in the constructor, has ?wsdl tacked on to the end of the service address - this causes the bugger to get the metadata for the service - basically, a template for the class to use to build the xml document.
I didn't put in all the parameters, just enough for you to get the idea. I don't have any way of running any tests because I don't have a service to play with and if I tried to write one I'd have no idea whether the problems lay in the server or the client ;). I also don't know if 'LocationService' is correct - hopefully you know the service name you're trying to access.
If playing with that for awhile gets you nowhere, it might be interesting to note that you can form the XML yourself and send it directly in the call method - you send it as a simple string that replaces the second parameter, which is an array above.
It also might be worthwhile to browse around and see if they have a non-soap method of doing what you want to do - I've found that to be true in a couple of cases.