title: How to get SOAP response from with PHP
body: <p>I am working on a SOAP web service</p>
  
  <p>And I made call into the web service to get all the methods with the code below</p>
  
  <pre><code>$client = new SoapClient("https://www.xxxxxxx.com/eSalesTest/webservice/xxx.asmx?wsdl");
  var_dump($client-&gt;__getFunctions()); 
  //var_dump($client-&gt;__getTypes());
  
  
  which gave me something like
  
   1 =&gt; string 'Save3rdPartyPolicyResponse Save3rdPartyPolicy(Save3rdPartyPolicy $parameters)' (length=77)
    2 =&gt; string 'SaveTravelPolicyResponse SaveTravelPolicy(SaveTravelPolicy $parameters)' (length=71)
    3 =&gt; string 'Book3rdPartyMotorResponse Book3rdPartyMotor(Book3rdPartyMotor $parameters)' (length=74)
    4 =&gt; string 'BookComprehensiveMotorResponse BookComprehensiveMotor(BookComprehensiveMotor $parameters)' (length=89)
    5 =&gt; string 'BookTravelPolicyResponse BookTravelPolicy(BookTravelPolicy $parameters)' (length=71)
    6 =&gt; string 'GetVehicleMakesResponse GetVehicleMakes(GetVehicleMakes $parameters)' (length=68)
    7 =&gt; string 'GetThirdPartyCategoriesResponse GetThirdPartyCategories(GetThirdPartyCategories $parameters)' (length=92)
    8 =&gt; string 'GetThridPartyPremiumResponse GetThridPartyPremium(GetThridPartyPremium $parameters)' (length=83)
    9 =&gt; string 'SaveComprehensiveMotorResponse SaveComprehensiveMotor(SaveComprehensiveMotor $parameters)' (length=89)
    10 =&gt; string 'BookMIPResponse BookMIP(BookMIP $parameters)' (length=44)
    11 =&gt; string 'SaveMIPResponse SaveMIP(SaveMIP $parameters)' (length=44)
  </code></pre>
  
  <p>However, what I want is to be able to get response request and populate it on my form.</p>
  
  <p>I already did that using soapUI and got the response in xml format like</p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/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;GetStatesResponse xmlns="http://tempuri.org/"&gt;
           &lt;GetStatesResult&gt;[{"Code":"6","Text":"Abia"},{"Code":"7","Text":"Adamawa"},{"Code":"8","Text":"Akwa Ibom"},{"Code":"9","Text":"Anambra"},{"Code":"10","Text":"Bauchi"},{"Code":"11","Text":"Bayelsa"},{"Code":"12","Text":"Benue"},{"Code":"13","Text":"Bornu"},{"Code":"14","Text":"Cross River "},{"Code":"15","Text":"Delta"},{"Code":"16","Text":"Ebonyi "},{"Code":"17","Text":"Edo"},{"Code":"18","Text":"Ekiti"},{"Code":"19","Text":"Enugu"},{"Code":"5","Text":"Federal Capital Territory"},{"Code":"42","Text":"Foreign Offices"},{"Code":"20","Text":"Gombe"},{"Code":"21","Text":"Imo"},{"Code":"22","Text":"Jigawa"},{"Code":"23","Text":"Kaduna"},{"Code":"24","Text":"Kano"},{"Code":"25","Text":"Katsina"},{"Code":"26","Text":"Kebbi"},{"Code":"27","Text":"Kogi"},{"Code":"28","Text":"Kwara"},{"Code":"29","Text":"Lagos"},{"Code":"30","Text":"Nasarawa"},{"Code":"31","Text":"Niger"},{"Code":"32","Text":"Ogun"},{"Code":"33","Text":"Ondo"},{"Code":"34","Text":"Osun"},{"Code":"35","Text":"Oyo"},{"Code":"36","Text":"Plateau"},{"Code":"37","Text":"Rivers"},{"Code":"38","Text":"Sokoto"},{"Code":"39","Text":"Taraba"},{"Code":"40","Text":"Yobe"},{"Code":"41","Text":"Zamfara"}]&lt;/GetStatesResult&gt;
        &lt;/GetStatesResponse&gt;
     &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>Kindly explain better what I'm doing or the next step to do as to do</p>