NuSoap and PEAR::SOAP response message
| From: | Anthony Colebourne | Date: | Wed, 21 May 2003 10:39:21 +0000 |
| Subject: | NuSoap and PEAR::SOAP response message | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-632@lists.php.net to get a copy of this message | ||
Hi,
The same function in a PEAR server and a NuSOAP server produce different response massages.
This causes interoperability problems, I'm using NuSoap 0.6.4 and PEAR 0.7.3
function getDepartment($inmessage) {
$link = mysql_connect($hostName, $userName, $password);
mysql_select_db($databaseName, $link);
$SQL = "SELECT .....";
$result = mysql_query($SQL, $>link);
while( $array = return mysql_fetch_array($result)) {
$resultEntry[] = array('title'=>$array['title'],
'forename'=>$array['forename'],
'surname'=>$array['surname']);
}
return array('name'=>'test', 'resultElements'=>$resultEntry);
}
PEAR
<SOAP-ENV:Body>
<ns4:getDepartmentResponse>
<return>
<name xsi:type="xsd:string">DELTA Project</name>
<resultElements xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="Struct[13]" SOAP-ENC:offset="[0]">
<item>
<title xsi:type="xsd:string">Mrs</title>
<forename xsi:type="xsd:string">Angela</forename>
<surname xsi:type="xsd:string">Smith</surname>
</item>
<item>
<title xsi:type="xsd:string">Mr</title>
<forename xsi:type="xsd:string">David</forename>
<surname xsi:type="xsd:string">Smith</surname>
</item>
</resultElements>
</return>
</ns4:getDepartmentResponse>
NuSOAP
<SOAP-ENV:Body>
<getDepartmentResponse>
<soapVal>
<name xsi:type="xsd:string">DELTA Project</name>
<resultElements xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="SOAP-ENC:Array[14,14]">
<item>
<title xsi:type="xsd:string">Mr</title>
<forename xsi:type="xsd:string">David</forename>
<surname xsi:type="xsd:string">Smith</surname>
</item>
<item>
<title xsi:type="xsd:string">Mr</title>
<forename xsi:type="xsd:string">Mike</forename>
<surname xsi:type="xsd:string">Smith</surname>
</item>
</resultElements>
</soapVal>
</getDepartmentResponse>