imagicstudios
asked on
PHP SOAP pass form array to WSDL on remote server
Dear Experts.
I am stuck on a small problem with PHP5 Soap / WSDL.
I need to pass the contents of a form to fill a WSDL on another server. This needs to be sent as an array.
The array is sent as a $param and I have attemted to do it like this:
$weborder = array('OrderID'=>$OrderID, 'UserName' =>$UserNam e,'Passwor d'=>$Passw ord,'CusID '=>$Dealer ID,'SiteID '=>$DealSi teID,'Titl e'=>$title ,'CusFname '=>$fname, 'CusLName' =>$lname, 'BillAddr1'=>$addr1, 'BillAddr2'=>$addr2, 'BillAddr3'=>$addr3, 'BillAddr4'=>$addr4, 'BillPCode'=>$postc, 'BillPhone'=>$phone, 'BillMobile'=>$mobile, 'BillEmail'=>$email);
$param["WebsiteOrder"] = $Weborder;
$client = new SoapClient("http://www.somewhere.com/service.asmx?WSDL");
$RIOresult = $client -> ReadInOrder($param);
And my hope was that it would populate this WSDL correctly
<ReadInOrder xmlns="http://www.somewhere.com/">
<OrderID>$OrderID</OrderID >
<UserName>$UserName</UserN ame>
<Password>$Password</Passw ord>
<WebsiteOrder>
<CusID>$DealerID</CusID>
<SiteID>$DealSiteID</SiteI D>
<Title>$title</Title>
<CusFName>$fname</CusFName >
<CusLName>$lname</CusLName >
<BillAddr1>$addr1</BillAdd r1>
<BillAddr2>$addr2</BillAdd r2>
<BillAddr3>$addr3</BillAdd r3>
<BillAddr4>$addr4</BillAdd r4>
<BillPCode>$postc</BillPCo de>
<BillPhone>$phone</BillPho ne>
<BillMobile>$mobile</BillM obile>
<BillEmail>$email</BillEma il>
</WebsiteOrder>
</ReadInOrder>
But the best I can get is this error
Uncaught SoapFault exception: [soap:Server] Server was unable to process request. ---> Object reference not set to an instance of an object. in C:\Inetpub\wwwroot........ etc
Can anyone help me decifer the problem and set me on the path to enlightenment!
many thanx
I am stuck on a small problem with PHP5 Soap / WSDL.
I need to pass the contents of a form to fill a WSDL on another server. This needs to be sent as an array.
The array is sent as a $param and I have attemted to do it like this:
$weborder = array('OrderID'=>$OrderID,
$param["WebsiteOrder"] = $Weborder;
$client = new SoapClient("http://www.somewhere.com/service.asmx?WSDL");
$RIOresult = $client -> ReadInOrder($param);
And my hope was that it would populate this WSDL correctly
<ReadInOrder xmlns="http://www.somewhere.com/">
<OrderID>$OrderID</OrderID
<UserName>$UserName</UserN
<Password>$Password</Passw
<WebsiteOrder>
<CusID>$DealerID</CusID>
<SiteID>$DealSiteID</SiteI
<Title>$title</Title>
<CusFName>$fname</CusFName
<CusLName>$lname</CusLName
<BillAddr1>$addr1</BillAdd
<BillAddr2>$addr2</BillAdd
<BillAddr3>$addr3</BillAdd
<BillAddr4>$addr4</BillAdd
<BillPCode>$postc</BillPCo
<BillPhone>$phone</BillPho
<BillMobile>$mobile</BillM
<BillEmail>$email</BillEma
</WebsiteOrder>
</ReadInOrder>
But the best I can get is this error
Uncaught SoapFault exception: [soap:Server] Server was unable to process request. ---> Object reference not set to an instance of an object. in C:\Inetpub\wwwroot........
Can anyone help me decifer the problem and set me on the path to enlightenment!
many thanx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.