I am having difficulty in getting a SOAP request working properly , which requires XML string as input.
It's throwing
"SOAP Fault: Server was unable to process request. ---> Value cannot be null. Parameter name: s"
no matter what input i send , i have used nusoap but to no avail , PHP soap library. The code i am using is:
<?
$aOptions = array(
'location' => 'http://webserviceurl.asmx',
'uri' => 'http://tempuri.org/',
"style" => SOAP_RPC,
"use" => SOAP_ENCODED
);
$client = new SOAPClient(null, $aOptions);
$request ='<item xmlns="rmsItem">
<columns>
<column>description</column>
<column>department</column>
<column>brand</column>
<column>lastsold</column>
<column>lastupdated</column>
<column>quantityonhand</column>
<column>weight</column>
</columns>
<filters>
<filter>
<filterColumn>quantityonhand</filterColumn>
<operator>greaterthan</operator>
<filterValue>20</filterValue>
</filter>
<filter>
<filterColumn>lastsold</filterColumn>
<operator>greaterthan</operator>
<filterValue>01-01-2005</filterValue>
</filter>
</filters>
<sortColumns>
<sortColumn>
<sortColumnName>lastsold</sortColumnName>
<sortType>ascending</sortType>
</sortColumn>
<sortColumn>
<sortColumnName>quantityonhand</sortColumnName>
<sortType>descending</sortType>
</sortColumn>
</sortColumns>
</item>';
//$result = $client->__soapCall('getAllInfo',array('infoRequestXml'=>(string)($request),'errorMessage'=>'') ,array('soapaction' => 'http://webserviceurl/getAllInfo'));
$soapvar = new SoapVar($request , XSD_ANYXML);
$params = array("infoRequestXml" => $soapvar);
//print_r($params);
//$result = $this->soapclient->__soapCall("SaveItem", array("parameters"=>$params), null, $this->soapheaders);
try
{
$result=$client->__soapCall('getAllInfo',array("parameters"=>$params),array('soapaction' => 'http://webserviceurl/getAllInfo'));
}
catch (SoapFault $e) {
echo "SOAP Fault: ".$e->getMessage()."<br />
";
}
echo "<pre>
";
echo htmlspecialchars($client->__getLastRequest())."
";
echo "Response:
".htmlspecialchars($client->__getLastResponse())."
";
echo "</pre>";
var_dump($result);
?>
I am banging my head against a wall from last two days, searched google for this problem but got no answer that solves or guide me through.
Anyone who can throw some light on this will be highly appreciated. Thanks in advance.