Re: [SOAP] accessing the results returned from webservice
| From: | Nathan Rixham | Date: | Thu, 08 Jan 2009 20:19:34 +0000 |
| Subject: | Re: [SOAP] accessing the results returned from webservice | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.soap php.soap |
| Request: | Send a blank email to php-soap+get-2890@lists.php.net to get a copy of this message | ||
Mansour Al Akeel wrote:
On Thu, Jan 08, 2009 at 03:01:11PM +0000, Richard Quadling wrote:if I may be so bold; I (along with thousands of others) use wso2; it may be worth considering (additionally you could knock a client up in 2 minutes using the provided wsdl2php scripts)2009/1/8 Christian Wenz <chw@hauser-wenz.de>:this prints out the whole response as one string without the tags brakets. So what ever the text of the all the tags is, it get appended and printed out.https isn't a registered stream for me it seems. What output do you get for ... var_dump($result);Do you haveThis test script <?php $soap = new SoapClient('https://beanstream.com/soap/ProcessTransaction.wsdl'); $result = $soap->TransactionProcess('<a />'); echo nl2br(htmlspecialchars(print_r($result, 1))); ?> returns: <response><trnId></trnId><trnApproved>0</trnApproved><messageId>0</messageIda public URL of the .NET web service?https://beanstream.com/soap/ProcessTransaction.wsdl<messageText>Invalid merchant id (merchant_id =0)</messageText><trnAuthCode></trnAuthCode></response> According to the WSDL, the return data type is a simple string. So the web service is returning XML, no matter which technology you use. So it's neither PHP's not .NET's fault :-) However since you are using PHP, you may want to use SimpleXML to parse the XML. --ChristianA soap client SHOULD return a stdClass object, so echo $result->messageText;This doesn't print anything. It's just empty. Same thing with: var_dump($result->messageText) ; it shows NULL Another thing (not related) is, I am passing the parameters as a nested array to the web method, however, I keep on getting invalid xml format. The test script in this email is passing a string and getting invalid merchant id. Hum, I will have to look further into this. I was waiting to be able to read the values from the response first.should work.No, this is not working at all.