Error in Implementing WS Security web service in WebLogic 10.3
- by Chris
Hi,
I am trying to develop a JAX WS web service with WS-Security features in WebLogic 10.3.
I have used the ant tasks WSDLC, JWSC and ClientGen to generate skeleton/stub for this web service.
I have two keystores namely WSIdentity.jks and WSTrust.jks which contains the keys and certificates. One of the alias of WSIdentity.jks is "ws02p".
The test client has the following code to invoke the web service:
SecureSimpleService service = new SecureSimpleService();
SecureSimplePortType port = service.getSecureSimplePortType();
List credProviders = new ArrayList();
CredentialProvider cp = new ClientBSTCredentialProvider(
"E:\\workspace\\SecureServiceWL103\\keystores\\WSIdentity.jks",
"webservice", "ws01p","webservice");
credProviders.add(cp);
string endpointURL="http://localhost:7001/SecureSimpleService/SecureSimpleService";
BindingProvider bp = (BindingProvider)port;
Map requestContext = bp.getRequestContext();
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
requestContext.put(WSSecurityContext.CREDENTIAL_PROVIDER_LIST,credProviders);
requestContext.put(WSSecurityContext.TRUST_MANAGER, new TrustManager() {
public boolean certificateCallback(X509Certificate[] chain,
int validateErr) {
// Put some custom validation code in here.
// Just return true for now
return true;
}
});
SignResponse resp1 = new SignResponse();
resp1 = port.echoSignOnlyMessage("hello sign");
System.out.println("Result: " + resp1.getMessage());
When I trying to invoke this web servcie using this test client I am getting the error "Invalid signing policy" with the following stack trace:
*[java] weblogic.wsee.security.wss.policy.SecurityPolicyArchitectureException: Invalid signing policy
[java] at weblogic.wsee.security.wss.plan.SecurityPolicyBlueprintDesigner.verifyPolicy(SecurityPolicyBlueprintDesigner.java:786)
[java] at weblogic.wsee.security.wss.plan.SecurityPolicyBlueprintDesigner.designOutboundBlueprint(SecurityPolicyBlueprintDesigner.java:136)
Am I missing any configuration settings in WebLogic admin console or is it do with something else.
Thanks in advance.