0

Is there a way to add an HTTP Header in a response of a SoapServer.

For example: I want the response of my SoapServer to add "Location", "http://localhost"

HTTP/1.1 307 Temporary Redirect

Location: http://localhost

Content-Type: text/xml; charset="utf-8"

Content-Length: 100

Red
  • 65
  • 9

2 Answers2

0

Very simple way to add more data to Soap is

function add_custom_data() {

            $outerObj = new stdClass();
            $innerObj = new stdClass();
            $innerObj->data1 = "MyData";
            $innerObj->data2 = "MyData2";
            $outerObj->innerObj = $innerObj;

            return $outerObj;
}

For Soap the Definition File has to match the elements in the Request / Response.

abdul rashid
  • 730
  • 9
  • 21
0

In your SoapServer, just add:

header('Location: http://localhost');

this will automatically add the 'Location' header as well as change the response code.

Red
  • 65
  • 9