How does PHP parse the data returned by the WEBSERVICES interface?

Source: Internet
Author: User
PHP how to parse the WEBSERVICE interface returned data WEBSERVICE server, they wrote an interface with. net & nbsp; http://XXX.XXX.XXX.XX/Info.asmx? Wsdl I use PHP to call this interface & nbsp; try {$ wsdl & nbsp; = & PHP how to parse the data returned by the WEBSERVICES interface
WEBSERVICE server, they wrote an interface http://XXX.XXX.XXX.XX/Info.asmx with. net? Wsdl
I used PHP to call this interface.

Try {
$ Wsdl = "http://XXX.XXX.XXX.XX/Info.asmx? Wsdl ";
$ Client = new SoapClient ($ wsdl );
$ Param = array ('strname' => 'Wu Xiaoming ', 'stridcard' => '4528xxxxxxxx', 'descipare' => '123 ');
$ Res = $ client-> GetBasicInfo ($ param );
Print_r ($ res );
} Catch (SOAPFault $ e ){
Var_dump ($ e );
}

The following result is displayed:


StdClass Object
(
[GetBasicInfoResult] => stdClass Object
(
[Any] =>

































4507 ............
4507 ............
Wu ......
Male
4528 ............
1966-03-10T00: 00: 00 + 08: 00
Road ............
2011-05-23T00: 00: 00 + 08: 00
2011-05-23T00: 00: 00 + 08: 00
2017-05-22T00: 00: 00 + 08: 00
Qinzhou ............
AAA
C1 certificate




)

)


[Any] => It is not like a standard XML. How can I use PHP to obtain these values?
Share:
------ Solution --------------------
The data you provided lacks the root node. add it by yourself.

The data is divided into two parts: the first part is the data type declaration, and the second part is the data
What we care about is the second part.
Use SimpleXMLElement to obtain
SimpleXMLElement Object
(
    [DocumentElement] => SimpleXMLElement Object
        (
            [Employee] => SimpleXMLElement Object
                (
                    [ID_ECERT] => 4507…………
                    [ECERTID] => 4507…………

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.