Loading ...
Sorry, an error occurred while loading the content.

9713Parsing soap response in PHP

Expand Messages
  • aimlion11
    Jan 13, 2004
      I have create a .net webservice, and am using a PHP page to consume
      it. I get the soap response back, but what do I do now? How to I
      parse the soap response so I can work with the data? In the
      Microsoft world we use the ActiveX Dom object. How do you do it in
      PHP?

      =================
      Link to client page
      ================
      http://www.astro-matchmaker.com/php_samples/Get_Profile.php


      ================
      php code in the client page
      ================
      <?
      $strDB = "members_demo"; // [members | members_demo]
      $strTokenID = "xxx111111x"; // xxx111111x forces
      connection to demo database.
      $strErrors = "";
      $strWhere = "";
      $xml_file = 'f:\home\nomax\astro-matchmaker.com\www\databases\az.xml';

      if(isset($_POST['SubmitGetProfile'])) {
      $strWhere = $_POST['strWhere'];
      //echo $strWhere;
      $SoapMsg = "";
      $SoapMsg = $SoapMsg . "<Get_Profile
      xmlns='ns.www.astromatchmaker.com'>";
      $SoapMsg = $SoapMsg . "<strTokenID>" .
      $strTokenID . "</strTokenID>";
      $SoapMsg = $SoapMsg . "<strDB>" . $strDB . "</strDB>";
      $SoapMsg = $SoapMsg . "<strWhere>" .
      $strWhere . "</strWhere>";
      $SoapMsg = $SoapMsg . "</Get_Profile>";

      include("NuSOAP/nusoap-0.6.1/nusoap.php");
      $soapclient = new soapclient('http://www.astro-
      matchmaker.com/aspnet_samples/MatchMaker.asmx?wsdl',true);
      $params = array($SoapMsg);
      $result = $soapclient -> call("Get_Profile", $params);

      echo $SoapMsg;
      echo $result;


      print_r($result);


      //Display the request and response
      echo '<h2>Request</h2>';
      echo '' . htmlspecialchars($soapclient->request, ENT_QUOTES) . '';
      echo '<h2>Response</h2>';
      echo '' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '';

      // kill object
      unset($soapclient);
      }


      ?>
    • Show all 4 messages in this topic