Hello,
I have a customer that supplied me with a WSDL and asked that we stand up a SOAP server based on that WSDL. We are a PHP shop, so we defined a basic soap server as follows:
class pipelineApplicationHandler {
public function AuthenticationHeader ($Username, $Password) {
// Do stuff here related to authenticationheader
}
public function SubmitApplications ($parameters="none") {
// Do stuff here related to SubmitApplications
}
}
$pipelineSoapServer = new SoapServer($_SERVER['DOCUMENT_ROOT'] . "/testBed/webServices/MRS_SubmitApplications_Webservice.wsdl");
$pipelineSoapServer->setClass("pipelineApplicationHandler");
$pipelineSoapServer->setPersistence(SOAP_PERSISTENCE_SESSION);
$data = file_get_contents('php://input');
$pipelineSoapServer->handle($data);
The incoming SOAP request is secured using WSSE and a MustUnderstand flag in the header requires the AuthenticationHeader method to be processed. When instantiate the SoapServer as above using their supplied WSDL, my script errors out with a SoapFault complaining that the Header was not understood. If I instead instantiate the SoapServer without the WSDL, and simply handle the request using the class as defined above, the AuthenticationHeader() function gets called and a response is posted back.
My issue is that if I do not use their supplied WSDL, the SoapResponse my script puts out will not fit their expected schema and bad things happen. I need to be able to use their WSDL, and still process the headers correctly.
I suspect that the issue here is that the SoapHeaders are being ignored by the handle() function. Stuffing $data with the php://input was supposed to resolve that issue, but still no luck.
Please help me correct this script so that it will correctly handle requests to methods defined in the headers of the Soap Request.
Thank you,
SR