web services - Call SAP webservice from SAP by php with parameters -
i know how call sap webservice php, how can send parameters request?
i tried following:
#define authentication $soap_auth = array( 'login' => 'user', 'password' => 'password'); #specify wsdl $wsdl = "http://xxxxxx/sap/bc/srt/wsdl/bndg_e417ca96fb8a5ff1b4a8000c293c9303/wsdl11/allinone/standard/document?sap-client=100"; #create client object, download , parse wsdl $client = new soapclient($wsdl,$soap_auth); $head_data = new stdclass(); $head_data->material = 'wm-999996'; $head_data->indsector = 'm'; $head_data->matltype = 'fert'; $head_data->basicview = 'x'; #setup input parameters (sap likes capitalise parameter names) $params = array( 'headdata' => $head_data ); #call operation (function). catch , display errors try { $result = $client->standardmaterialsavedata($params); } catch (soapfault $exception) { print "***caught exception***\n"; print_r($exception); print "***end exception***\n"; die(); } #out results print_r($result);
but gives me following error: soap-error: encoding: object has no 'headdata' property
i think following lines wrong:
$head_data = new stdclass(); $head_data->material = 'wm-999996'; $head_data->indsector = 'm'; $head_data->matltype = 'fert'; $head_data->basicview = 'x';
can please me , tell me how add head_data variable correctly onto webservice call?
Comments
Post a Comment