我正在尝试用Java开发SOAP WebService客户端,但我无法对其进行身份验证。 我有来自我的提供商的用户和密码,而wsdl是这样的:
https://www.ictower.net/Services/MasterService.svc?wsdl
使用eclipse我会生成服务clases和Stub类,但是当我尝试进行身份验证时,总是会收到此消息
An error occurred when verifying security for the message.
我试过了
IMasterServiceProxy ICTService = new IMasterServiceProxy();
MasterServiceLocator ICTLocator = new MasterServiceLocator();
URL urlServicio = new URL("https://www.ictower.net/Services/MasterService.svc");
BasicHttpBinding_IMasterServiceStub stub = new BasicHttpBinding_IMasterServiceStub(urlServicio, ICTLocator);
stub.setUsername("XXXXX");
stub.setPassword("XXXXX");
我也尝试使用_setProperty而不是setter
stub._setProperty(BasicHttpBinding_IMasterServiceStub.USERNAME_PROPERTY, "XXXXX");
stub._setProperty(BasicHttpBinding_IMasterServiceStub.PASSWORD_PROPERTY, "XXXXX");
但总是当我调用任何服务方法时,总是相同的返回(错误验证安全性......)
我完全迷失了,我花了很多时间尝试和搜索......欢迎任何帮助