All, I'm attempting to write a Junit test that calls a Web Service client in Axis2.1.5, and I've gotten confused about how to exactly to set it up to use WS-Addressing.
I've generated a client stub using wsdl2java, and I'm using the axis2.xml and modules repository from the axis2 binary distribution.
I know I need to use the MemberSubmission version of the WS-Addressing, and I think I've got that set up correctly (using Options), but the headers don't seem to get generated correctly. (I say 'seem' because I can't figure out how to the SOAPMonitor module working either - I'd welcome any tips on that too!).
My main confusion, though, is around what exactly it takes to 'engage' the Addressing module. Should it be enough to set up my ConfigurationContext with an axis2.xml file that has a reference to the addressing module? Like this? :
//standard out of the box axis2 configsConfigurationContext myConfigContext =ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:/devapps/axis2-1.5.1/repository","C:/devapps/axis2-1.5.1/conf/axis2.xml");Options options =newOptions();EndpointReference targetEPR =newEndpointReference("https://host:port/service.asmx");
options.setTo(targetEPR);//I believe this is what I'm supposed to do to specify the //MemberSubmission version of WS-Addressing
options.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);//No idea of this is needed or not.
options.setAction("someAction");CaseDetailsServiceStub stub =newCaseDetailsServiceStub("https://host:port/service.asmx");
stub._getServiceClient().setOptions(options);//I'm calling this from a Junit test
With my options set up like above, is see in the log file that the modules are getting loaded from axis2.xml: