Link to home
Start Free TrialLog in
Avatar of imagicstudios
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'=>$UserName,'Password'=>$Password,'CusID'=>$DealerID,'SiteID'=>$DealSiteID,'Title'=>$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</UserName>
      <Password>$Password</Password>
      <WebsiteOrder>
        <CusID>$DealerID</CusID>
        <SiteID>$DealSiteID</SiteID>
        <Title>$title</Title>
        <CusFName>$fname</CusFName>
        <CusLName>$lname</CusLName>
        <BillAddr1>$addr1</BillAddr1>
        <BillAddr2>$addr2</BillAddr2>
        <BillAddr3>$addr3</BillAddr3>
        <BillAddr4>$addr4</BillAddr4>
        <BillPCode>$postc</BillPCode>
        <BillPhone>$phone</BillPhone>
        <BillMobile>$mobile</BillMobile>
        <BillEmail>$email</BillEmail>

 </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


ASKER CERTIFIED SOLUTION
Avatar of cubical10
cubical10

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial