I am trying to secure SOAP requests using WSO2’s Web Services Framework for PHP.
Here is my request:
$reqPayloadString = <<<XML
<echo>
<echoRequest>TEST</echoRequest>
</echo>
XML;
$reqMessage = new WSMessage($reqPayloadString,
array("to" => "http://localhost/service/echo",
"action" => "echo"));
$sec_token = new WSSecurityToken(array("user" => "myusername",
"password" => "mypassword",
"passwordType" => "Digest"));
$client = new WSClient(array("useWSA" => TRUE,
"policy" => new WSPolicy(file_get_contents("policy.xml")),
"securityToken" => $sec_token));
$resMessage = $client->request($reqMessage);
However, I receive the following error:
Missing wsse:Security header in request
How should I set the wsse:Security header in the request above?
I have not been able to solve this unfortunately. I have tried the tips suggest by @Peter in his response.
I am now using PHP/Java Bridge and native Java classes to make the secure request.