NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
using soap response with simplexml


Joined: 21 Oct 2010
Posts: 1
Reply with quote
Hi I have the following code

Code:

<?php
$body = '
<FeaturesForProductType xmlns="https://api.URL.asmx">
<userName>XXXXXX</userName>
<xmlParameters>
<![CDATA[
<FeaturesLookup xmlns="http://tempuri.org/DummySchema.xsd">
<authorisation>
<password>XXXX</password>
</authorisation>
<request>
<ProductTypeCode>311</ProductTypeCode>
</request>
</FeaturesLookup>
]]>
</xmlParameters>
</FeaturesForProductType>
';

require_once('nusoap.php');
$s = new nusoap_client('https://URL.asmx',false);
$msg = $s->serializeEnvelope($body);
$s ->send($msg,'https://api.URL.asmx/FeaturesForProductType');

echo $response= $s->response;


and I am getting this response

Code:


HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Thu, 21 Oct 2010 15:39:59 GMT
Content-Length: 1911

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><FeaturesForProductTypeResponse xmlns="https://api.hoseasons.co.uk/HoseasonsAPI.asmx"><FeaturesForProductTypeResult><_userErrorString /><contentString>&lt;?xml version="1.0" encoding="ISO-8859-15"?&gt;&lt;features&gt;&lt;feature&gt;&lt;name&gt;Detached&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;NonSmoking&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;FourPoster&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;EnclosedGarden&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;PrivateHotTub&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;IndoorPool&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;OutdoorPool&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;GamesRoom&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;MultiBathShower&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;PubCloseBy&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;FishingOnSite&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;SandyBeach5Miles&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;Sea5Miles&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;WheelchairAccess&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;OpenFire&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;ShortBreak&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;RomanticBreak&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;Ultimate&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;PetFriendly&lt;/name&gt;&lt;/feature&gt;&lt;feature&gt;&lt;name&gt;EasyWalkingAccess&lt;/name&gt;&lt;/feature&gt;&lt;/features&gt;</contentString></FeaturesForProductTypeResult></FeaturesForProductTypeResponse></soap:Body></soap:Envelope><br />


My question is how do I get the the xml in the <contentString> so I can then parse it using something like simplexml?

sorry if this is a stupid question but I have never used nusoap before and nothing I have tried has worked

Thank you
View user's profileFind all posts by rlparker81Send private message


Joined: 21 Nov 2010
Posts: 1
Reply with quote
I too would like to send XML data as a string. Is there any way to turn off this escaping?
View user's profileFind all posts by vinci91Send private message


Joined: 26 Jul 2007
Posts: 14
Reply with quote
have you tried:

php's
html_entity_decode()

to convert it, and then bring it into simplexml?
View user's profileFind all posts by addisonpSend private message
American Bridal


Joined: 01 Nov 2011
Posts: 1
Reply with quote
Bath wedding favors and soap wedding favors are classic hostess gifts for any wedding. Our collection includes triple-milled French soaps, Shea butter-infused soaps, and lightly scented hand creams personalized with the bride’s and groom’s name. These luxurious bath wedding favors and soap wedding favors offer your guests a little pampering in stylish packaging and seasonal shapes.

americanbridal.com/bridal-shower-game-hh20510.html
View user's profileFind all posts by Winthrop02Send private message


Joined: 06 Nov 2011
Posts: 1
Location: Los Angeles
Reply with quote
wow sounds good wedding in bath, I hope I will get that wedding with my registered wife !
View user's profileFind all posts by hamelameSend private messageYahoo Messenger
using soap response with simplexml
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic