Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ho to retrive value from this xml message

Status
Not open for further replies.

Jefhandle

Technical User
Mar 9, 2005
69
0
0
DE

Hi,
In a client code I become a soap message from a server. There are Informations which should be retrieved like ID, IsTemplate, description etc.


Here is a sample of the soap body message:
<SOAP-ENV:Body>
...............


<ts:response>
<ts:factory>


<ts:products>

<ts:status>
<ts:code>0x00000000</ts:code>
<ets:description>Success</ts:description>
</ts:status>
<ts:product1>
<ts:Description>This xyxyx </ts:Description>

<ts:ID>{6E8EDC33-C8DA-49DE-A865-5F49BF96E029}</ts:ID>
<ts:IsTemplate>true</ts:IsTemplate>

</ts:product1>



<ts:product2>
<ts:Description>This xyxyx </ts:Description>

<ts:ID>{6E8EDC33-C8DA-49DE-A865-5F49BF96E029}</ts:ID>
<ts:IsTemplate>true</ts:IsTemplate>

</ts:product2>




</ts:response>


</ts:products>
</ts:factory>


</SOAP-ENV:Body>

Any Idea how it could be done?

Thanks for any help
 
parse the xml to an array using one of the built in functions? or regular expressions perhaps?
Code:
$pattern = '/<ts:Description>(.*?)<\/ts:Description>/ix';
preg_match($pattern, $soap_output, $matches);
echo $match[1];
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top