I had no problem running the following code in my controller.
SoapWrapper::add(function ($service) {
$service
->name('Testing')
->wsdl('http://example.asmx?WSDL')
->trace(true);
});
// Using the added service
SoapWrapper::service('Testing', function ($service) use ($data) {
print_r($service->call('Function1', []));
//print_r($service->getLastRequestHeaders());
});
Following is my request HTTP header.
POST http://example.asmx HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://tempuri.org/Function1"
Content-Length: 214
Host: some_host
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
randomName:some_session_id //<------------which i want to add
But let say I want to add randomName: some_session_id
into the HTTP header, what/how should I do it? Have try -header()
and customHeader()
but this only add into the xml envelope header which is not I want.