title: Call SAP webservice from SAP by php with parameters
body: <p>I know how to call a SAP webservice from php, but how can I send parameters with my request?</p>
  
  <p>I tried the following:</p>
  
  <pre><code>    #Define Authentication 
    $SOAP_AUTH = array( 'login'    =&gt; 'user',
                        'password' =&gt; 'password');
  
    #Specify WSDL
    $WSDL = "http://xxxxxx/sap/bc/srt/wsdl/bndg_E417CA96FB8A5FF1B4A8000C293C9303/wsdl11/allinone/standard/document?sap-client=100";
  
    #Create Client Object, download and parse WSDL
    $client = new SoapClient($WSDL,$SOAP_AUTH);
  
    $HEAD_DATA = new stdClass();
    $HEAD_DATA-&gt;Material = 'WM-999996';
    $HEAD_DATA-&gt;IndSector = 'M';
    $HEAD_DATA-&gt;MatlType = 'FERT';
    $HEAD_DATA-&gt;BasicView = 'X';
  
    #Setup input parameters (SAP Likes to Capitalise the parameter names)
    $params = array(
            'HEADDATA' =&gt; $HEAD_DATA
    );
  
    #Call Operation (Function). Catch and display any errors
    try
    {
       $result = $client-&gt;StandardMaterialSaveData($params);
    }
    catch (SoapFault $exception)
    {
        print "***Caught Exception***\n";
        print_r($exception);
        print "***END Exception***\n";
        die();
    }
  
    #Out the results
    print_r($result);
  </code></pre>
  
  <p>But it gives me the following error: SOAP-ERROR: Encoding: object has no 'HeadData' property</p>
  
  <p>I think that the following lines are wrong: </p>
  
  <pre><code>  $HEAD_DATA = new stdClass();
    $HEAD_DATA-&gt;Material = 'WM-999996';
    $HEAD_DATA-&gt;IndSector = 'M';
    $HEAD_DATA-&gt;MatlType = 'FERT';
    $HEAD_DATA-&gt;BasicView = 'X';
  </code></pre>
  
  <p>Can anyone please help me and tell me how to add the HEAD_DATA variable correctly onto the webservice call?</p>