I've made a LITTLE progress. I am now constructing a SOAP Request, with data.
If I construct the XML as a variable, and send with nusoap, the SOAP Request looks well formed. Some progress.
Not sure if that's the correct way to do it or not, but its totally different from the PHP soapclient, which requires an array.
Anyway, I'm still getting an error in my SOAP Response, and I wonder if it's down to the nusoap naming of the tags, specifically SOAP-ENV.
The example Request I have been given as what the WSDL file is expecting, has the tags named as soapenv:
Does anyone know if :
a) that's going to cause an error
b) if I can tell nusoap to format my tags with soapenv, not SOAP-ENV
Also, the nusoap Request adds this line:
xmlns:ns6316="http://tempuri.org">
I can effect the namespace to one of my own, but where does it get :ns6316. According to the example given to me, that tag shouldn't be there.
Here's what I'm trying to replicate:
<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<QASearch xmlns="http://www.qas.com/web-2005-10">
<Country>GBR</Country>
<Engine Flatten="true">Authenticate</Engine>
<Layout>< Default ></Layout>
<QAConfig />
<SearchSpec>
<SearchTerm Key="CTRL_SEARCHCONSENT">Yes</SearchTerm>
<SearchTerm Key="NAME_TITLE" />
<SearchTerm Key="NAME_FORENAME">john</SearchTerm>
<SearchTerm Key="NAME_INITIALS" />
<SearchTerm Key="NAME_SURNAME">smith</SearchTerm>
<SearchTerm Key="NAME_DATEOFBIRTH">01/01/1999</SearchTerm>
<SearchTerm Key="NAME_SEX" />
<SearchTerm Key="ADDR_FLAT" />
<SearchTerm Key="ADDR_HOUSENAME">George West House</SearchTerm>
<SearchTerm Key="ADDR_HOUSENUMBER">2-3</SearchTerm>
<SearchTerm Key="ADDR_STREET">Clapham Common North Side</SearchTerm>
<SearchTerm Key="ADDR_DISTRICT" />
<SearchTerm Key="ADDR_TOWN">LONDON</SearchTerm>
<SearchTerm Key="ADDR_COUNTY" />
<SearchTerm Key="ADDR_POSTCODE">SW4 0QL</SearchTerm>
</SearchSpec>
</QASearch>
</soapenv:Body>
</soapenv:Envelope>
And this is what nusoap is producing:
<?xml version="1.0" encoding="UFT-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns9310="http://tempuri.org">
<SOAP-ENV:Body>
<QASearch xmlns="http://www.qas.com/web-2005-10">
<Country>GBR</Country>
<Engine Flatten="true" PromptSet="Default">Authenticate</Engine>
<Layout>< Default ></Layout>
<QAConfig />
<SearchSpec>
<SearchTerm Key="CTRL_SEARCHCONSENT">Yes</SearchTerm>
<SearchTerm Key="NAME_TITLE" />
<SearchTerm Key="NAME_FORENAME">john</SearchTerm>
<SearchTerm Key="NAME_INITIALS" />
<SearchTerm Key="NAME_SURNAME">smith</SearchTerm>
<SearchTerm Key="NAME_DATEOFBIRTH">01/01/1999</SearchTerm>
<SearchTerm Key="NAME_SEX" />
<SearchTerm Key="ADDR_FLAT" />
<SearchTerm Key="ADDR_HOUSENAME">George West House</SearchTerm>
<SearchTerm Key="ADDR_HOUSENUMBER">2-3</SearchTerm>
<SearchTerm Key="ADDR_STREET">Clapham Common North Side</SearchTerm>
<SearchTerm Key="ADDR_DISTRICT" />
<SearchTerm Key="ADDR_TOWN">LONDON</SearchTerm>
<SearchTerm Key="ADDR_COUNTY" />
<SearchTerm Key="ADDR_POSTCODE">SW4 0QL</SearchTerm>
</SearchSpec>
</QASearch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
and this is the error I'm getting back:
RESPONSE:
HTTP/1.0 200 OK Content-Length: 349 Content-Type: text/xml
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>-4600</faultstring>
<detail>Failed to parse or validate XML against the schema; invalid parameters</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I thought previously that the < > in the Layout tag were causing a problem, but that was wrong, and lost me two days.
Initially, I used the PHP soapclient to attempt this, but came across the same error. The difference was the PHP client was producing tags like <ns1:SearchTerm>. I was told, that was the cause of the error, however, nusoap is now producing tags without this namespace: and I'm still getting the error.
could it be the soapenv / SOAP-ENV difference ?
HELP ?! Anybody ?!