Jump to content

How to automatically format SOAP responses


antonb

Recommended Posts

Well I found out one thing. Before you can parse the SOAP response you need to remove some colons with:

$response = $client->__getLastResponse();

$clean_response = preg_replace("/(<\/?)(\w+)[^>]*>)/", "$1$2$3", $response);

 

NOW all I have to do is figure out how to parse a normal XML document. There is a ton of documentation on that so I should be all set... I'm a pretty big noob though so who knows.

Soo... when I try to parse the file I get nothin.

 

This is the beginning of the SOAP reply.

 

<soapenvEnvelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenvHeader/><soapenvBody>

 

Notice the <soapenvHeader/> (after I removed the ":" with preg_replace); could this be messing up SimpleXML?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.