Re: [SOAP] accessing the results returned from webservice
[email protected] (Mansour Al Akeel)
| Newsgroups | php.soap |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jan 08, 2009 at 02:13:15PM +0100, Christian Wenz wrote:
> > Do you have
> > > a public URL of the .NET web service?
> >
> > https://beanstream.com/soap/ProcessTransaction.wsdl
> >
>
> This 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</messageId
> ><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 :-)
Ok I got it. It's my fault for not checking what is the return type
and/or the implementation should not return all these values as string
for easier access.
Now, regardless of who's fault :-) , how where you able to tell that the
return type is simple or not ? I couldn't see any pointer to this.
> However since you are using PHP, you may
> want to use SimpleXML to parse the XML.
>
> --Christian
>
>
>
>
> --
> PHP Soap Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>