title: How to parse SOAP response without SoapClient
body: <p>I have spent the last few days trying to parse a SOAP response but I can't get it to work. I would like to be able to get all the "oproduct" objects.</p>
  
  <p>EDIT: I am doing it this way instead of using the built in SOAP client because I need to do parallel requests using multi_curl.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$xml = simplexml_load_string($response);
  $xml-&gt;registerXPathNamespace('soap-env', 'http://schemas.xmlsoap.org/soap/envelope/');
  foreach ($xml-&gt;xpath('//oproduct') as $item)
  {
    // do something
  }
  </code></pre>
  
  <p>Here is the response:</p>
  
  <pre><code>&lt;soap-env:envelope xmlns:ns1="http://v3.core.com.productserve.com/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap-env:body&gt;
      &lt;ns1:getproductlistresponse&gt;
        &lt;oproduct&gt;
          &lt;iid&gt;113133802&lt;/iid&gt;
          &lt;icategoryid&gt;270&lt;/icategoryid&gt;
          &lt;imerchantid&gt;1547&lt;/imerchantid&gt;
          &lt;iadult&gt;0&lt;/iadult&gt;
          &lt;sname&gt;The Ashes / 5th Test - England v Australia - Day 1&lt;/sname&gt;
          &lt;sawdeeplink&gt;http://www.awin1.com/pclick.php?p=113133802&amp;amp;a=111402&amp;amp;m=1547&amp;amp;platform=cs&lt;/sawdeeplink&gt;
          &lt;sawthumburl&gt;http://images.productserve.com/thumb/1547/113133802.jpg&lt;/sawthumburl&gt;
          &lt;fprice&gt;119.99&lt;/fprice&gt;
        &lt;/oproduct&gt;
        &lt;oproduct&gt;
          &lt;iid&gt;113133791&lt;/iid&gt;
          &lt;icategoryid&gt;270&lt;/icategoryid&gt;
          &lt;imerchantid&gt;1547&lt;/imerchantid&gt;
          &lt;iadult&gt;0&lt;/iadult&gt;
          &lt;sname&gt;The Ashes / 1st Test - England v Australia - Day 1&lt;/sname&gt;
          &lt;sawdeeplink&gt;http://www.awin1.com/pclick.php?p=113133791&amp;amp;a=111402&amp;amp;m=1547&amp;amp;platform=cs&lt;/sawdeeplink&gt;
          &lt;sawthumburl&gt;http://images.productserve.com/thumb/1547/113133791.jpg&lt;/sawthumburl&gt;
          &lt;fprice&gt;69.99&lt;/fprice&gt;
        &lt;/oproduct&gt;
        &lt;oproduct&gt;
          &lt;iid&gt;51155349&lt;/iid&gt;
          &lt;icategoryid&gt;428&lt;/icategoryid&gt;
          &lt;imerchantid&gt;513&lt;/imerchantid&gt;
          &lt;iadult&gt;0&lt;/iadult&gt;
          &lt;sname&gt;Rapitest DTM 118 Damp Test Meter&lt;/sname&gt;
          &lt;sawdeeplink&gt;http://www.awin1.com/pclick.php?p=51155349&amp;amp;a=111402&amp;amp;m=513&amp;amp;platform=cs&lt;/sawdeeplink&gt;
          &lt;sawthumburl&gt;http://images.productserve.com/thumb/513/51155349.jpg&lt;/sawthumburl&gt;
          &lt;fprice&gt;18.35&lt;/fprice&gt;
        &lt;/oproduct&gt;
        &lt;oproduct&gt;
          &lt;iid&gt;187948&lt;/iid&gt;
          &lt;icategoryid&gt;474&lt;/icategoryid&gt;
          &lt;imerchantid&gt;496&lt;/imerchantid&gt;
          &lt;iadult&gt;0&lt;/iadult&gt;
          &lt;sname&gt;Rapitest Dm 10 Electrical Multimeter&lt;/sname&gt;
          &lt;sawdeeplink&gt;http://www.awin1.com/pclick.php?p=187948&amp;amp;a=111402&amp;amp;m=496&amp;amp;platform=cs&lt;/sawdeeplink&gt;
          &lt;sawthumburl&gt;http://images.productserve.com/thumb/496/187948.jpg&lt;/sawthumburl&gt;
          &lt;fprice&gt;26.71&lt;/fprice&gt;
        &lt;/oproduct&gt;
        &lt;oproduct&gt;
          &lt;iid&gt;51155353&lt;/iid&gt;
          &lt;icategoryid&gt;428&lt;/icategoryid&gt;
          &lt;imerchantid&gt;513&lt;/imerchantid&gt;
          &lt;iadult&gt;0&lt;/iadult&gt;
          &lt;sname&gt;Rapitest DM 10 Electrical Multimeter&lt;/sname&gt;
          &lt;sawdeeplink&gt;http://www.awin1.com/pclick.php?p=51155353&amp;amp;a=111402&amp;amp;m=513&amp;amp;platform=cs&lt;/sawdeeplink&gt;
          &lt;sawthumburl&gt;http://images.productserve.com/thumb/513/51155353.jpg&lt;/sawthumburl&gt;
          &lt;fprice&gt;22.7&lt;/fprice&gt;
        &lt;/oproduct&gt;
        &lt;oproduct&gt;
          &lt;iid&gt;49152850&lt;/iid&gt;
          &lt;icategoryid&gt;474&lt;/icategoryid&gt;
          &lt;imerchantid&gt;1366&lt;/imerchantid&gt;
          &lt;iadult&gt;0&lt;/iadult&gt;
          &lt;sname&gt;Testboy Profi LED Plus&lt;/sname&gt;
          &lt;sawdeeplink&gt;http://www.awin1.com/pclick.php?p=49152850&amp;amp;a=111402&amp;amp;m=1366&amp;amp;platform=cs&lt;/sawdeeplink&gt;
          &lt;sawthumburl&gt;http://images.productserve.com/thumb/1366/49152850.jpg&lt;/sawthumburl&gt;
          &lt;fprice&gt;44.99&lt;/fprice&gt;
        &lt;/oproduct&gt;
        &lt;oproduct&gt;
          &lt;iid&gt;51155350&lt;/iid&gt;
          &lt;icategoryid&gt;428&lt;/icategoryid&gt;
          &lt;imerchantid&gt;513&lt;/imerchantid&gt;
          &lt;iadult&gt;0&lt;/iadult&gt;
          &lt;sname&gt;Rapitest ETP 116 Electrical Test Probe&lt;/sname&gt;
          &lt;sawdeeplink&gt;http://www.awin1.com/pclick.php?p=51155350&amp;amp;a=111402&amp;amp;m=513&amp;amp;platform=cs&lt;/sawdeeplink&gt;
          &lt;sawthumburl&gt;http://images.productserve.com/thumb/513/51155350.jpg&lt;/sawthumburl&gt;
          &lt;fprice&gt;17.55&lt;/fprice&gt;
        &lt;/oproduct&gt;
        &lt;oproduct&gt;
          &lt;iid&gt;51155351&lt;/iid&gt;
          &lt;icategoryid&gt;428&lt;/icategoryid&gt;
          &lt;imerchantid&gt;513&lt;/imerchantid&gt;
          &lt;iadult&gt;0&lt;/iadult&gt;
          &lt;sname&gt;Rapitest ET 111 Electrical Test Meter&lt;/sname&gt;
          &lt;sawdeeplink&gt;http://www.awin1.com/pclick.php?p=51155351&amp;amp;a=111402&amp;amp;m=513&amp;amp;platform=cs&lt;/sawdeeplink&gt;
          &lt;sawthumburl&gt;http://images.productserve.com/thumb/513/51155351.jpg&lt;/sawthumburl&gt;
          &lt;fprice&gt;13.55&lt;/fprice&gt;
        &lt;/oproduct&gt;
        &lt;oproduct&gt;
          &lt;iid&gt;72326941&lt;/iid&gt;
          &lt;icategoryid&gt;474&lt;/icategoryid&gt;
          &lt;imerchantid&gt;496&lt;/imerchantid&gt;
          &lt;iadult&gt;0&lt;/iadult&gt;
          &lt;sname&gt;Rapitest Etp 116 Electrical Test Probe&lt;/sname&gt;
          &lt;sawdeeplink&gt;http://www.awin1.com/pclick.php?p=72326941&amp;amp;a=111402&amp;amp;m=496&amp;amp;platform=cs&lt;/sawdeeplink&gt;
          &lt;sawthumburl&gt;http://images.productserve.com/thumb/496/72326941.jpg&lt;/sawthumburl&gt;
          &lt;fprice&gt;20.66&lt;/fprice&gt;
        &lt;/oproduct&gt;
        &lt;oproduct&gt;
          &lt;iid&gt;49338340&lt;/iid&gt;
          &lt;icategoryid&gt;206&lt;/icategoryid&gt;
          &lt;imerchantid&gt;80&lt;/imerchantid&gt;
          &lt;iadult&gt;0&lt;/iadult&gt;
          &lt;sname&gt;Ladies Protest Zekke Jacket True Black&lt;/sname&gt;
          &lt;sawdeeplink&gt;http://www.awin1.com/pclick.php?p=49338340&amp;amp;a=111402&amp;amp;m=80&amp;amp;platform=cs&lt;/sawdeeplink&gt;
          &lt;sawthumburl&gt;http://images.productserve.com/thumb/80/49338340.jpg&lt;/sawthumburl&gt;
          &lt;fprice&gt;54.99&lt;/fprice&gt;
        &lt;/oproduct&gt;
        &lt;itotalcount&gt;6350&lt;/itotalcount&gt;
      &lt;/ns1:getproductlistresponse&gt;
    &lt;/soap-env:body&gt;
  &lt;/soap-env:envelope&gt;
  </code></pre>