我在此地址https://fcsa-test-preval-ws.gaa.qc.ca/fcsa-preval.svc?wsdl上有一个名为FCSAPreval的Web服务。
我能够使用wsimport
命令从Web服务的WSDL获取所有类。
在尝试使用肥皂访问此服务时遇到问题,我的代码是:
String WS_URL = "https://fcsa-test-preval-ws.gaa.qc.ca/fcsa-preval.svc?singlewsdl";
ws.FCSAPreval svc = new ws.FCSAPreval();
ws.FcsaPrevalWs proxy = svc.getWSHttpBindingFcsaPrevalWs();
WebServiceFeature wsAddressing = new AddressingFeature(true);
((BindingProvider)proxy).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "Username");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "Password");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, WS_URL);
try {
InfoPrevalidation info = proxy.obtenirInfoPrevalidation("koadokadk");
System.out.println(info.toString());
} catch (FcsaPrevalWsObtenirInfoPrevalidationFauteFCSAFaultFaultMessage e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
它不断抛出此错误:
oct. 10, 2019 9:11:04 AM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector] selectAlternatives
AVERTISSEMENT: WSP0075: Policy assertion "{http://schemas.xmlsoap.org/ws/2005/07/securitypolicy}SignedSupportingTokens" was evaluated as "UNKNOWN".
oct. 10, 2019 9:11:04 AM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector] selectAlternatives
AVERTISSEMENT: WSP0075: Policy assertion "{http://schemas.xmlsoap.org/ws/2005/07/securitypolicy}TransportBinding" was evaluated as "UNKNOWN".
oct. 10, 2019 9:11:04 AM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector] selectAlternatives
AVERTISSEMENT: WSP0075: Policy assertion "{http://schemas.xmlsoap.org/ws/2005/07/securitypolicy}Trust10" was evaluated as "UNKNOWN".
oct. 10, 2019 9:11:04 AM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector] selectAlternatives
AVERTISSEMENT: WSP0075: Policy assertion "{http://schemas.xmlsoap.org/ws/2005/07/securitypolicy}Wss11" was evaluated as "UNKNOWN".
oct. 10, 2019 9:11:04 AM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector] selectAlternatives
AVERTISSEMENT: WSP0075: Policy assertion "{http://www.w3.org/2006/05/addressing/wsdl}UsingAddressing" was evaluated as "UNKNOWN".
oct. 10, 2019 9:11:04 AM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector] selectAlternatives
AVERTISSEMENT: WSP0019: Suboptimal policy alternative selected on the client side with fitness "UNKNOWN".
任何帮助。