Hi,

 

I tried to invoke a web service using my Axis2 ServiceClient API, and I
kept getting a null pointer.

So I decided to debug the source code and I found out that the
transportsOut HashMap in the AxisConfiguration class is empty. This
means that Axis2 could not really infer the transport out from the URL.

 

This is the client side code I've written:

 

String inputXml = serializeElement(input, procedure);

OMElement payload = createPayload(inputXml);

Options options = new Options();

options.setExceptionToBeThrownOnSOAPFault(true);

options.setTo(new
EndpointReference(procedure.getExternalWsServiceUrl()));

try {

ServiceClient client = new
ServiceClient(ConfigurationContextFactory.createEmptyConfigurationContex
t(),new URL(procedure.getExternalWsServiceWsdlUrl()),new
QName(procedure.getExternalWebServiceNamespace(),
procedure.getExternalWsServiceName()),
procedure.getExternalWsServicePortName());

      client.setOptions(options);

      OMElement response = client.sendReceive(new
QName(procedure.getExternalWebServiceNamespace(), procedure.getName()),
payload);

} catch (Exception ex) {

      ex.printStackTrace();

}

 

I'm not sure if this is a bug or simply a misusage of the API.

 

Thanks,

Shahar Kedar

 

 

Reply via email to