title: Web Services (wsdl) with Php
body: <p>I have been working on php for a long time but this time i have a got an API where i have to connect with a WSDL file using php , i have tried a lot different ways but i am not getting any response.</p>
  
  <p>Here's my wsdl file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;wsdl:definitions
  name="WMSMSWS"
  targetNamespace="http://www.gspl.com/wms/wtystatus"
  xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:tns="http://www.gspl.com/wms/wtystatus"
  xmlns:xsd1="http://www.gspl.com/wms/wtystatus/xsd"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  &lt;wsdl:types&gt;
  &lt;xsd:schema
     targetNamespace="http://www.gspl.com/wms/wtystatus/xsd"
     xmlns="http://www.w3.org/2001/XMLSchema"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     elementFormDefault="qualified"&gt;
  
    &lt;xsd:element name="wtyStatusData"&gt;
      &lt;xsd:complexType&gt;
        &lt;xsd:sequence&gt;
          &lt;xsd:element minOccurs="1" maxOccurs="1"
                       name="machineSerialNo" type="xsd:string" /&gt;
          &lt;xsd:element minOccurs="1" maxOccurs="1"
                       name="serviceUserId" type="xsd:string" /&gt;
        &lt;/xsd:sequence&gt;
      &lt;/xsd:complexType&gt;
    &lt;/xsd:element&gt;
  
    &lt;xsd:element name="wtyStatusDataResponse"&gt;
      &lt;xsd:complexType&gt;
        &lt;xsd:sequence&gt;
        &lt;xsd:element minOccurs="1" maxOccurs="1"
                       name="status" type="xsd:string" /&gt;
        &lt;xsd:element minOccurs="0" maxOccurs="1"
                       name="error" type="xsd:string" /&gt;
        &lt;xsd:element minOccurs="0" maxOccurs="1"
                       name="wtyStatus" type="xsd:string" /&gt;
        &lt;xsd:element minOccurs="0" maxOccurs="1"
                       name="modelNo" type="xsd:string" /&gt;
        &lt;xsd:element minOccurs="0" maxOccurs="1"
                       name="wtyEndDate" type="xsd:string" /&gt;
        &lt;/xsd:sequence&gt;
      &lt;/xsd:complexType&gt;
    &lt;/xsd:element&gt;
    &lt;/xsd:schema&gt;
  &lt;/wsdl:types&gt;
  &lt;wsdl:message name="wtyStatusData"&gt;
  &lt;wsdl:part name="parameters" element="xsd1:wtyStatusData" /&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="wtyStatusDataResponse"&gt;
  &lt;wsdl:part name="parameters" element="xsd1:wtyStatusDataResponse" /&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:portType name="WMSMSWSPortType"&gt;
   &lt;wsdl:operation name="wtyStatusData"&gt;
    &lt;wsdl:input message="tns:wtyStatusData" /&gt;
    &lt;wsdl:output message="tns:wtyStatusDataResponse" /&gt;
    &lt;/wsdl:operation&gt;
    &lt;/wsdl:portType&gt;
     &lt;wsdl:binding name="WMSMSWSPortBinding"
              type="tns:WMSMSWSPortType"&gt;
     &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http"
                style="document" /&gt;
  
     &lt;wsdl:operation name="wtyStatusData"&gt;
    &lt;soap:operation soapAction="http://www.gspl.com/wms/wtystatus/wtyStatusData"
                    style="document" /&gt;
    &lt;wsdl:input&gt;
      &lt;soap:body use="literal" /&gt;
    &lt;/wsdl:input&gt;
    &lt;wsdl:output&gt;
      &lt;soap:body use="literal" /&gt;
    &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
   &lt;/wsdl:binding&gt;
   &lt;wsdl:service name="WtyStatus"&gt;
    &lt;wsdl:port name="WMSMSWSPort" binding="tns:WMSMSWSPortBinding"&gt;
    &lt;soap:address location="http://ecsm.net:8080/wms/services/WtyStatus" /&gt;
   &lt;/wsdl:port&gt;
     &lt;/wsdl:service&gt;
    &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p>and the php i am writing for it</p>
  
  <pre><code>  &lt;?php
  require_once('nusoap.php'); 
  $wsdl="http://ecsm.net:8080/wms/services/WtyStatus";
  $client=new soapclient($wsdl, 'wsdl');
  
  $machineSerialNo = 'KZ10187M';
  $serviceUserId = 'LBZ01554';
  
  $param=array(
      'machineSerialNo' =&gt; $machineSerialNo, 
      'serviceUserId' =&gt; $serviceUserId
      );
  
  $result = $client-&gt;call('WMSMSWS', $param);
  
  echo $client-&gt;getError();
  
  print_r($result);
  </code></pre>
  
  <p>I am using Soap to connect to it , Machine Serial No and Service User Id are unique given to me from a company.</p>
  
  <p>Thanks </p>