开发者

Using PHP's SoapClient, how to deserialize SOAP responses into a custom class?

开发者 https://www.devze.com 2023-02-16 20:55 出处:网络
I have a PHP Web application that consumes a Web Service usi开发者_高级运维ng PHP\'s native SoapClient class. By default, SoapClient deserializes the Web Service\'s SOAP responses into stdClass object

I have a PHP Web application that consumes a Web Service usi开发者_高级运维ng PHP's native SoapClient class. By default, SoapClient deserializes the Web Service's SOAP responses into stdClass objects. I would like to override this default. How can I do that?


You can use SoapClient's __getLastResponse() method to get the raw XML response back as a string instead of an object.

Additionally you can overwrite it's do request method by extending the SoapClient class.

0

精彩评论

暂无评论...
验证码 换一张
取 消