我必须调用一个使用来自Spring java的基本身份验证的SOAP服务。 我有服务存根,并且知道需要调用的操作。
String finalRequestString="Entire Request string";
MYServiceStub mySVCStub= new MYServiceStub();
MYSVCSubmitInformationDocument objSubmitInformationDoc=
MYSVCSubmitInformationDocument.Factory.newInstance();
MySVCSubmitInformation objSubmitInfo = objSubmitInformationDoc.addSubmitInformation(); //service specific methods
objSubmitInfo.setXml(finalRequestString); //Request String
ServiceClient client = mySVCStub._getServiceClient();
Options options = mySVCStub._getServiceClient().getOptions();
Map<String, String> requestHeaders = new HashMap<>();
requestHeaders.put("Authorization","Basic encodedUserNamePassword as it appears in SOAP UI request");
options.setProperty(HTTPConstants.HTTP_HEADERS, requestHeaders);
response= mySVCStub.submitInformation(objSubmitInformationDoc);
但是我收到错误org.apache.axis2.AxisFault:给定的SOAPAction http://MYVC.../mySVCsubmitInformation与操作不匹配。
任何帮助将不胜感激。 谢谢