Jump to content

Recommended Posts

Hi Guys,

I have this SOAP message to be parsed using SimpleXML:

    <isokresponse xmlns="http://tempuri.org/">

Then I load the XML:

$xml = simplexml_load_string($result);

I assume I need to register namespace e.g.


But what's next? How do I get the value of the element isokresult?

Thank you so much

Link to post
Share on other sites

If all you want is the isokresult then you can get it... well, I won't say "easily" because SOAP just loves using namespaces, but it is a one-liner. Kinda. Don't need XPath.

	->children("http://schemas.xmlsoap.org/soap/envelope/") // switch to soap namespace
	->body // <soap:body>
	->children("http://tempuri.org/") // switch to this isokwhatever namespace
	->isokresponse // <isokresponse>
	->isokresult // <isokresult> (still in the isok namespace)


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.