1

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.

4

1 に答える 1

0

https エンドポイントに設定された「to」エンドポイントで動作するには、https の CACert オプションを指定する必要があります。wsdl モードにはいくつかの既知の問題があるため、非 wsdl モードも使用してください。

于 2012-09-30T14:40:59.817 に答える