title: php soap client for uk mail webservice api?
body: <p>I'm working on a commerce site on which orders are placed. To track that delivery I need to give a link to users with all the parameters from a form filled by user to create a delivery and track its status using UK Mail with the link provided in a mail.</p>
  
  <p>I have to use UK Mail Web Service API. Can anyone show me how to do so? I am new to SOAP WSDL.</p>
  
  <p>From my understanding i did this now how to go further? My code below its just basic client i need to:</p>
  
  <ol>
  <li><p>authenticate login and use the authenticate token</p></li>
  <li><p>I need to send the parameters to create a domestic assignments</p></li>
  <li><p>I need to track the delivery status too</p></li>
  </ol>
  
  <p>here is my updated code :</p>
  
  <pre><code>&lt;?php 
  
  $LoginWebRequest = new stdClass();
  $LoginWebRequest-&gt;Username = 'xxx cant show here xxx';
  $LoginWebRequest-&gt;Password = 'xxx cant show here xxx';
  
  //echo "&lt;pre&gt;";  print_r($LoginWebRequest); "&lt;/pre&gt;"; exit;
  
  $Login = new stdClass();
  $Login-&gt;loginWebRequest = $LoginWebRequest;
  
  //echo "&lt;pre&gt;";  print_r($Login); "&lt;/pre&gt;"; exit; 
  
  $soapClient = new SoapClient('somewsdl?wsdl');
  $LoginResponse = $soapClient-&gt;Login($Login);
  
  //echo "&lt;pre&gt;";  print_r($LoginResponse); "&lt;/pre&gt;"; exit; 
  
  $LoginResponse = $soapClient-&gt;Login($Login);
  
  
  // -- till here my code runs fine and also gives the failed output but adding the code //below gives me error cant find out whats wrong 
  
  
  $AuthenticationToken = $LoginResponse-&gt;LoginResult-&gt;AuthenticationToken;
  
  
  
  $AddDomesticConsignmentWebRequest = new stdClass();
  $AddDomesticConsignmentWebRequest-&gt;Username = 'xxxxxx';
  // setting the Authentication Token from the previous step
  $AddDomesticConsignmentWebRequest-&gt;AuthenticationToken = $AuthenticationToken ;
  // other properties are set here...
  
  $AddDomesticConsignment = new stdClass();
  $AddDomesticConsignment-&gt;request = $AddDomesticConsignmentWebRequest;
  
  
  $soapClient = new SoapClient('https://svc?wsdl');
  $AddDomesticConsignmentResponse = $soapClient-&gt;AddDomesticConsignment($AddDomesticConsignment);
  
  
  ?&gt;
  </code></pre>
  
  <p>i have solved all and got my consignment no too just need to track my api </p>
  
  <p>my xml is like this or u can check the pdf</p>
  
  <pre><code>     Example XML Request:
      &lt;soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"        xmlns:thir="http://webapp-cl.internet-delivery.com/ThirdPartyIntegrationService"&gt;
      &lt;soap:Header/&gt;
      &lt;soap:Body&gt;
      &lt;thir:ConsignmentTrackingSearchV1&gt;
      &lt;thir:UserName&gt;mail.com&lt;/thir:UserName&gt;
      &lt;thir:Password&gt;123&lt;/thir:Password&gt;
      &lt;thir:Token&gt;&lt;/thir:Token&gt;
      &lt;thir:ConsignmentNumber&gt;01161&lt;/thir:ConsignmentNumber&gt;
      &lt;thir:IsPartialConsignmentNumber&gt;false&lt;/thir:IsPartialConsignmentNumber&gt;
      &lt;thir:CustomerReference&gt;&lt;/thir:CustomerReference&gt;
      &lt;thir:IsPartialCustomerReference&gt;false&lt;/thir:IsPartialCustomerReference&gt;
      &lt;thir:DeliveryPostCode&gt;&lt;/thir:DeliveryPostCode&gt;
      &lt;thir:MailingID&gt;&lt;/thir:MailingID&gt;
      &lt;thir:MaxResults&gt;100&lt;/thir:MaxResults&gt;
      &lt;/thir:ConsignmentTrackingSearchV1&gt;
      &lt;/soap:Body&gt;
      &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>example xml response</p>
  
  <pre><code>      &lt;soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
         &lt;soap:Body&gt;
         &lt;ConsignmentTrackingSearchV1Response xmlns="http://webapp-cl.internet- delivery.com/ThirdPartyIntegrationService"&gt;
          &lt;ConsignmentTrackingSearchV1Result&gt;
          &lt;ResultState&gt;Successful&lt;/ResultState&gt;
           &lt;ConsignmentResults&gt;
         &lt;ConsignmentSearchResult&gt;
      &lt;ConsignmentNumber&gt;001161&lt;/ConsignmentNumber&gt;
      &lt;CustomerRef1/&gt;
     &lt;CustomerRef2/&gt;
       &lt;SubCustomerRef1/&gt;
       &lt;SubCustomerRef2/&gt;
        &lt;DeliveryType/&gt;
        &lt;ConsignmentStatus&gt;Delivered&lt;/ConsignmentStatus&gt;
        &lt;DateTimeDelivered&gt;2010-02-11T12:00:00+00:00&lt;/DateTimeDelivered&gt;
        &lt;ItemsDelivered&gt;2&lt;/ItemsDelivered&gt;
        &lt;RecipientName&gt;robin&lt;/RecipientName&gt;
        &lt;DeliveryComments/&gt;
        &lt;ExpectedDeliveryDate&gt;2010-02-11T00:00:00&lt;/ExpectedDeliveryDate&gt;
         &lt;DeliveryService&gt;Next Day&lt;/DeliveryService&gt;
        &lt;TotalItems&gt;2&lt;/TotalItems&gt;
        &lt;Consignmentkey&gt;22&lt;/Consignmentkey&gt;
          &lt;/ConsignmentSearchResult&gt;
           &lt;/ConsignmentResults&gt;
          &lt;/ConsignmentTrackingSearchV1Result&gt;
          &lt;/ConsignmentTrackingSearchV1Response&gt;
          &lt;/soap:Body&gt;
         &lt;/soap:Envelope&gt;
  </code></pre>