I am trying to connect to a WSDL that uses WS-Security Certificate Signing over HTTPS.
Only the outgoing messages are signed and it uses Binary Security Token (could not find this specific option in WSO2 but so I am unsure I am using the correct option in the code below).
I have looked at the code in the Samples of the WSO2 WSF/PHP and have joined together the WDSL client example and the Signing example.
Code:
$my_cert = ws_get_cert_from_file("./keys/cert.pem");
$my_key = ws_get_key_from_file("./keys/key.pem");
$sec_array = array("sign"=>TRUE,
"algorithmSuite" => "Basic256Rsa15",
"securityTokenReference" => "EmbeddedToken"); //Is this correct for Binary Security Token?
$policy = new WSPolicy(array("security"=>$sec_array));
$sec_token = new WSSecurityToken(array("privateKey" => $my_key,
"certificate" => $my_cert));
$client = new WSClient(array("wsdl"=>"https://.../Informationservice.WSDL",
"useWSA" => TRUE,
"policy" => $policy,
"securityToken" => $sec_token));
$proxy = $client->getProxy();
$return_val = $proxy->StreetTypes();
Any help would be much appreciated as I haven't been able to find an examples of connecting to a service like this online anywhere. Most services seem to sign with Username and Password rather than Certificates and when looking for WSDL and Certificate Signing I don't find anything at all.