Creating XML nodes with SOAP and PHP -
i need generate soap request looks this:
<s11:envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'> <s11:body> <ns1:savequote xmlns:ns1='http://domain.com/bdb/'> <ns1:clienttype></ns1:clienttype> <ns1:claims> <ns1:claimhistory> <ns1:nature></ns1:nature> </ns1:claimhistory> </ns1:claims> <ns1:vehicles> <ns1:vehicle> <ns1:province></ns1:province> </ns1:vehicle> </ns1:vehicles> </ns1:savequote> </s11:body> </s11:envelope>
i have :
$url = 'http://somedomain.com/soapurl.asmx?wsdl'; try { $client = new soapclient($url); $savequote = array('clienttype' => $clienttype); $claims = array('nature' => $nature); $vehicles = array('province' => $province) $response = $client->__soapcall( 'savequote', array('parameters' =>$savequote), 'claims', array('claimhistory' =>$claims), 'vehicles', array('vehicle' => $vehicles)); var_dump($response); } catch (exception $soapexception) { printf('errors:\n',$soapexception->__tostring()); return false; }
but generates error.. how nodes correct within request?
you should use objects match required parameter types. can use wsdl php generator ease generation of each required class each parameter type. allows use classmap soapclient option you'll have response php objects, easier arrays...
Comments
Post a Comment