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…………