Hi
I've got a soap request which is failing, and I'm wondering if its down to the < > not being parsed correctly, as everything else looks good.
Here are the bits:
This is my request:
$authenticate = array(
'Country' => 'GBR',
'Engine' => array ('_' => 'Authenticate', 'Flatten' => true, 'PromptSet' => 'Default'),
'Layout' => '< Default >',
'SearchSpec' => array(
array('_' => 'Yes', 'Key' => 'CTRL_SEARCHCONSENT'),
array('_' => 'MR', 'Key' => 'NAME_TITLE'),
array('_' => 'Zuzu', 'Key' => 'NAME_FORENAME'),
array('_' => '', 'Key' => 'NAME_INITIALS'),
array('_' => 'Zuzu', 'Key' => 'NAME_SURNAME'),
array('_' => '12/12/1956', 'Key' => 'NAME_DATEOFBIRTH'),
array('_' => 'M', 'Key' => 'NAME_SEX'),
array('_' => '', 'Key' => 'ADDR_FLAT'),
array('_' => '', 'Key' => 'ADDR_HOUSENAME'),
array('_' => '27', 'Key' => 'ADDR_HOUSENUMBER'),
array('_' => 'Manor Road', 'Key' => 'ADDR_STREET'),
array('_' => 'Alresford', 'Key' => 'ADDR_DISTRICT'),
array('_' => 'Zuzuchester', 'Key' => 'ADDR_TOWN'),
array('_' => '', 'Key' => 'ADDR_COUNTY'),
array('_' => 'CO4 4LT', 'Key' => 'ADDR_POSTCODE')
)
);
and if I do a
print_r($authenticate);
I get:
Array (
[Country] => GBR
[Engine] => Array ( [_] => Authenticate [Flatten] => 1 [PromptSet] => Default )
[Layout] => < Default >
[SearchSpec] => Array (
[0] => Array ( [_] => Yes [Key] => CTRL_SEARCHCONSENT )
[1] => Array ( [_] => MR [Key] => NAME_TITLE )
[2] => Array ( [_] => Zuzu [Key] => NAME_FORENAME )
[3] => Array ( [_] => [Key] => NAME_INITIALS )
[4] => Array ( [_] => Zuzu [Key] => NAME_SURNAME )
[5] => Array ( [_] => 12/12/1956 [Key] => NAME_DATEOFBIRTH )
[6] => Array ( [_] => M [Key] => NAME_SEX )
[7] => Array ( [_] => [Key] => ADDR_FLAT )
[8] => Array ( [_] => [Key] => ADDR_HOUSENAME )
[9] => Array ( [_] => 27 [Key] => ADDR_HOUSENUMBER )
[10] => Array ( [_] => Manor Road [Key] => ADDR_STREET )
[11] => Array ( [_] => Alresford [Key] => ADDR_DISTRICT )
[12] => Array ( [_] => Zuzuchester [Key] => ADDR_TOWN )
[13] => Array ( [_] => [Key] => ADDR_COUNTY )
[14] => Array ( [_] => CO4 4LT [Key] => ADDR_POSTCODE )
)
)
which looks fine [thanks to johanafm and shrike]
so, I run my call as normal:
$response_doAuthenticate = $client->DoSearch($authenticate);
but, I get the error:
RESPONSE:
<?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 <qas:QAFault xmlns:qas="http://www.qas.com/web-2005-10"> <qas:ErrorCode>-4600</qas:ErrorCode>
<qas:ErrorMessage>Failed to parse or validate XML against the schema; invalid parameters</qas:ErrorMessage>
</qas:QAFault>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
when I getLastRequest(), you can see that the request has < and > around the Layout tag.
REQUEST:
<?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>
[B]<ns1:Layout><Default></ns1:Layout>[/B]
<ns1:SearchSpec>
<ns1:SearchTerm Key="CTRL_SEARCHCONSENT">Yes</ns1:SearchTerm>
<ns1:SearchTerm Key="NAME_TITLE">MR</ns1:SearchTerm>
<ns1:SearchTerm Key="NAME_FORENAME">Zuzu</ns1:SearchTerm>
<ns1:SearchTerm Key="NAME_INITIALS"></ns1:SearchTerm>
<ns1:SearchTerm Key="NAME_SURNAME">Zuzu</ns1:SearchTerm>
<ns1:SearchTerm Key="NAME_DATEOFBIRTH">12/12/1956</ns1:SearchTerm>
<ns1:SearchTerm Key="NAME_SEX">M</ns1:SearchTerm>
<ns1:SearchTerm Key="ADDR_HOUSENUMBER">27</ns1:SearchTerm>
<ns1:SearchTerm Key="ADDR_STREET">Manor Road</ns1:SearchTerm>
<ns1:SearchTerm Key="ADDR_DISTRICT">Alresford</ns1:SearchTerm>
<ns1:SearchTerm Key="ADDR_TOWN">Zuzuchester</ns1:SearchTerm>
<ns1:SearchTerm Key="ADDR_POSTCODE">CO4 4LT</ns1:SearchTerm>
</ns1:SearchSpec>
</ns1:QASearch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Is that likely to cause the problem, or am I barking up the wrong tree ?
THANKS!!