0

Is it possible to input raw SOAP web service response ( read from file ) to the PHP SoapClient as string and get response object mapped in classmap?

Basicly same thing like usually SoapClient would be used, except I have response XML already.

Bojan Bijelić
  • 355
  • 1
  • 4
  • 8
  • Short answer: No. Only practical way I can think of is read the file via HTTP request from localhost. You may also need to proxy the transfer through a PHP script as SoapClient can be very funny about response headers. – DaveRandom May 21 '12 at 11:50
  • You could also parse it with an XML parser like simplexml, though wouldn't be the same as a mapped object. Another option would be to modify the Nusoap client to take the SOAP envelope without a HTTP request, and use Nusoap as your client. – MrCode May 21 '12 at 12:17

1 Answers1

0

Maybe you can create a local SOAP Server in PHP and call a method on it with your SOAP client. Then, you make the server method return your SOAP string by constructing it from objects, the proper way, or by using the quick and dirty approach: https://stackoverflow.com/a/8749213/1174378 which allows you to alter the contents of the SOAP message before sending it to the client.

Community
  • 1
  • 1
Mihai Todor
  • 8,014
  • 9
  • 49
  • 86