soap - SoapClient insert multiple params into some fields with PHP -
i'm trying soap request structure like:
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:wseasyrent:wseasyrent"> <soapenv:header/> <soapenv:body> <urn:getcustomersv3> <accessid></accessid> <er_custcode></er_custcode> <er_groupcode></er_groupcode> <custcard></custcard> <custextid></custextid> <custextidorigin></custextidorigin> <firstname></firstname> <lastname></lastname> <zip></zip> <city></city> <dateofbirth></dateofbirth> <telephone></telephone> <mobile></mobile> <email></email> <created_after></created_after> <changed_after></changed_after> <activity_after></activity_after> <maxrows></maxrows> </urn:getcustomersv3>
i've tried many methods, neither work should... here first part of code:
$options = array( "trace" => 1, "cache_wsdl" => wsdl_cache_none ); $client = new soapclient($webservicehost, $options); trying array:
$parr = array( 'accessid' => 'mypassword', 'er_custcode' => 'custcode' ); try { $ret = $client->getcustomersv3($parr); } catch (exception $e) { $ret = $e->faultstring; } result array:
<ns1:getcustomersv3> <accessid>array</accessid> <er_custcode></er_custcode> trying object:
$obj = new stdclass(); $obj->accessid = 'mypassword'; $obj->er_custcode = 'custcode'; // or format: // $obj[] = new soapvar('custcode', xsd_string, null, null, 'er_custcode' ); try { $ret = $client->getcustomersv3(new soapvar($parm, soap_enc_object)); } catch (exception $e) { $ret = $e->faultstring; } result object:
<ns1:getcustomersv3> <accessid> <accessid>custcode</accessid> <er_custcode>mypassword</er_custcode> </accessid> <er_custcode></er_custcode> what need is:
<ns1:getcustomersv3> <accessid>custcode</accessid> <er_custcode>mypassword</er_custcode> thanks lot!
the solution inserting params 1 one so:
$ez_soap = new soapclient($pageurl,array('trace' => 1)); $response = $ez_soap->getcustomersv3($params[0],$params[1],'','','','','','','','',$params[2],'','','',$params[3],$params[4],$params[5],$params[6]);
Comments
Post a Comment