Re: accessing the results returned from webservice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/1/8 Christian Wenz <chw@hauser-wenz.de>:
>> 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 :-) However since you are using PHP, you may
> want to use SimpleXML to parse the XML.
>
> --Christian

https isn't a registered stream for me it seems.

What output do you get for ...

var_dump($result);

A soap client SHOULD return a stdClass object, so

echo $result->messageText;

should work.




-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux