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

i advise wsdltophp or website wsdl php


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -