我正在嘗試在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中管理控制檯的任何配置設置或將其與別的東西嗎?