I have written a web service client to call the getVersion operation of the Version service that is part of the axis2 distribution.

The following code works fine


ServiceClient client = new ServiceClient();
client.setTargetEPR(new
EndpointReference("http://localhost:5050/axis2/services/Version?wsdl";));
                
// set the options
Options options = client.getOptions();
options.setAction("urn:getVersion");
                
// build the request
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace tns1 = fac.createOMNamespace("http://axisversion.sample";, "tns1");
OMElement getVersion = fac.createOMElement("getVersion", tns1);
OMElement response = client.sendReceive(getVersion);



now I want to test being able to receive the response on a different connection to the request. I have a couple of lines to the code to engage the addressing module and to use a separate listener.

ServiceClient client = new ServiceClient();
client.setTargetEPR(new
EndpointReference("http://localhost:5050/axis2/services/Version?wsdl";));
client.engageModule(new QName(Constants.MODULE_ADDRESSING));
options.setUseSeparateListener(true);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
                
// set the options
Options options = client.getOptions();
options.setAction("urn:getVersion");
                
// build the request
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace tns1 = fac.createOMNamespace("http://axisversion.sample";, "tns1");
OMElement getVersion = fac.createOMElement("getVersion", tns1);
OMElement response = client.sendReceive(getVersion);


When I execute the code I get the following exception

Exception in thread "main" org.apache.axis2.AxisFault: Unable to engage module : addressing at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:298)
        at com.comware.axis2.examples.VersionClient.main(VersionClient.java:29)


Can anyone provide some assistance in moving this forward. I have tried setting the -Daxsi2.xml=<path to axis2.xml file> property on the command line but then I get the following error

Caused by: org.apache.axis2.deployment.DeploymentException: Invalid Handler phase rule has not been specified at org.apache.axis2.deployment.DescriptionBuilder.processHandler(DescriptionBuilder.java:295) at org.apache.axis2.deployment.AxisConfigBuilder.processPhaseList(AxisConfigBuilder.java:261) at org.apache.axis2.deployment.AxisConfigBuilder.processPhaseOrders(AxisConfigBuilder.java:292) at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:107) at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:690) at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:109) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:61) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory
.java:180)
at org.apache.axis2.client.ServiceClient.initializeTransports(ServiceClient.java:189) at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:118) at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:114) at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:207) at com.comware.axis2.examples.VersionClient.main(VersionClient.java:27)

cheers
</jima>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to