Hi.
I'm stuck.
I have a requirement for a specific namespace within a soap request. I had previously been using soap client, and it worked well, but now I need to specify an alternate namespace, but I can't work out how to use soapClient in non-WSDL mode.
My requirement is to build the following soap request:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:qas="http://www.qas.com/web-2005-10">
<SOAP-ENV:Body>
<qas:QASearch>
<qas:Country>GBR</qas:Country>
<qas:Engine Flatten="true" PromptSet="Default">Authenticate</qas:Engine>
<qas:Layout><Default></qas:Layout>
<qas:SearchSpec>
..... DATA IN HERE [removed to make things easier]
</qas:SearchSpec>
</qas:QASearch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
What I'm currently doing is using sending an arry to soapClient, but it forms it like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.qas.com/web-2005-10">
<SOAP-ENV:Body>
<ns1:QASearch>
<ns1:Country>GBR</ns1:Country>
<ns1:Engine Flatten="true" PromptSet="Default">Authenticate</ns1:Engine>
<ns1:Layout><Default></ns1:Layout>
<ns1:SearchSpec>
.... DATA REMOVED to make things easier
</ns1:SearchSpec>
</ns1:QASearch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Note the ns1: namespace at the front of the tags.
THIS IS THE PROBLEM!
I either need to removed the ns1: altogther, or change to qas:
Now, I think you can build you're own header like this:
$client = new SoapClient(null, array('location' => "http://localhost/soap.php",
'uri' => "http://test-uri/",
'style' => SOAP_DOCUMENT,
'use' => SOAP_LITERAL));
but I can find no decent documentation!
What is the location file. what is the uri link ?
Does anyone know if I can build and send a SOAP request as per the first bit of code ??
Thanks if you've got down this far ... HELP!