PHP + Calling SOAP API

Viewed 576

I am working with SOAP API first time, and I am trying to get response from below function, Function Name is : getProducts()

<soapenv:Body>
  <ser:GetProducts>
     <product_references>
        <product_reference>REF1</product_reference>
        <product_reference>REF2</product_reference>
     </product_references>
     <get_data/>
     <file_type>xml</file_type>
     <limit/>
     <offset/>
  </ser:GetProducts>

This is how I am trying to call this function (Below):

  $param[] = new \SoapVar('<get_data  xsi:nil="'.$auto_update.'" />', XSD_ANYXML);

  $param[] = new \SoapVar('xml', XSD_STRING, "file_type ", "http://www.w3.org/2001/XMLSchema");

    $param[] = new \SoapVar('SB/EIF/WDS/EMGRN/NAT', XSD_STRING, "product_reference", "http://www.w3.org/2001/XMLSchema");


  $result = $this->request('GetProducts', $param);

There is another function I have "GetNewOrders"

 <SOAP-ENV:Body>
<ns1:GetNewOrders>
  <auto_update xsi:nil="true"/>
  <file_type xsi:nil="true"/>
</ns1:GetNewOrders>
</SOAP-ENV:Body>

I am successfully able to get response from above function by using below code

 $param = new \SoapVar('<auto_update xsi:nil="'.$auto_update.'" />', XSD_ANYXML);

    $result = $this->request('GetNewOrders', $param);

I want to know How could I pass parameters or in which syntax to get products. Any help would be great.

0 Answers
Related