0

My task is to setup a server in PHP (5.3) and respond to client with already prepared message.

Is there's any method to post/respond with raw data with SoapServer, NusoapServer or Zend?

hakre
  • 193,403
  • 52
  • 435
  • 836
spamec
  • 301
  • 1
  • 5
  • 15
  • When you say "respond with raw data", do you mean (A) utilize one of those libraries to construct and transmit the response, but including some binary data as part of the response document or (B) create the entire response document yourself and send it as "raw data"? – JamesG Feb 22 '12 at 02:46
  • I mean the second of your options... – spamec Feb 22 '12 at 08:41
  • In details, my server should retrieve raw XML, process it and then send response in raw XML.... – spamec Feb 22 '12 at 09:47

1 Answers1

2

If you want to retrieve the raw XML request document, process it and then send the raw XML response document, then none of the aforementioned libraries are probably going to help you, because they are all specifically intended to shield you from that complexity.

In order to receive the raw XML data you will need to read the raw POST data, which is best done like this:

$requestDocument = file_get_contents('php://input');

Then you'll need to process it, construct your response document and transmit it using print or echo.

JamesG
  • 4,288
  • 2
  • 31
  • 36