我正在尝试在WebLogic 10.3中开发具有WS-Security功能的JAX WS Web服务。 我已经使用了ant任务WSDLC,JWSC和ClientGen来为此Web服务生成框架/存根。在WebLogic 10.3中实现WS Security Web服务时出错
我有两个keystore,分别是包含密钥和证书的WSIdentity.jks和WSTrust.jks。 WSIdentity.jks的别名之一是“ws02p”。
测试客户端具有下面的代码来调用Web服务:
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<String, Object> 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());
当我尝试使用这个测试客户端,我得到错误“无效签名策略”和以下堆栈来调用这个网站servcie追踪:
*[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)
我失去了在WebLogic中管理控制台的任何配置设置或将其与别的东西吗?