Hey Guys,

I appreciate any and all help.

I'm trying to print out the results of a query I've made to another server using the nusoap client. I'm successfully sending my XML Array to their WSDL web service and they are sending an XML response back. <RESULTS><TEXT>Success</TEXT></RESULTS>

However all < and > symbols are missing. Quotes and every other symbol is intact.

I'm using the nusoap classes and functions, and I'm wondering if there is a parameter perhaps that I need to pass so that the data retains its XML structure or?


So when they send back their results it looks like this....

RESULTSTEXTSuccess/TEXT/RESULTS

The code I'm using to open the soapclient and gather the results its pretty simply. I'm not setting any paramters outside

$args = array ("xml"=>$str); 
$client = new soapclient($url,"wsdl"); $results = $client->call("User_Data", $args);

Thanks again.

Edit/Delete Message

Recommended Answers

All 3 Replies

Coolguy20,

Did you ever get this figured out? The string can't be parsed as xml because the < and > characters are missing. I am having the same issue and trying to solve this as well.

I thought I would update how I hacked the response to get what I expected. I got the responseData from the soap object, removed the soap header and trailer information, converted &lt; to < and &gt; to >. Below is a sample code snippet.

Tim...

$response = $soap->responseData;
  // force clean up the soap junk
  // find the position of the soap:Body location.
  $leadin = '<soap:Body>';
  $pos = strpos($response, $leadin);
  if ($pos !== false) {
    $response = substr($response, $pos + strlen($leadin));
  }
  $leadout = '</soap:Body></soap:Envelope>';
  $response = substr($response, 0, 0 - strlen($leadout));
  // now change all &lt; and &gt; to < and > 
  $response = str_replace('&lt;',"<",$response);
  $response = str_replace('&gt;',">",$response);
  // and get rid of the xml encoding buried in the response.
  $response = str_replace('<?xml version="1.0" encoding="UTF-8"?>',"",$response);
  // now throw it into a simplexml object
  $SExml = new SimpleXMLElement($response);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.