You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Leon Koch <Le...@global-health.com> on 2011/10/14 09:44:07 UTC

Axis 1.6 not handling methods with null parameters

Hi,

We have encountered an issue when upgrading from Axis 1.5.4 to 1.6.0

We have several WSDLs containing methods without parameters, eg:

<wsdl:operation name="getDisciplinesIndividuals">
  <wsdl:input message="ns:getDisciplinesIndividualsRequest" wsaw:Action="urn:getDisciplinesIndividuals">
</wsdl:input>

...

<wsdl:message name="getDisciplinesIndividualsRequest">
</wsdl:message>

This WSDL was generated from a Java class using axis 1.5.4 tool java2wsdl.
We then generated server side stubs using wsdl2java.
This WSDL + stub code handled client requests without soap parameters (the method being specified in the 'action' http header). eg

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header/>
   <soap:Body/>
</soap:Envelope>

However, when updating the server stub to axis 1.6.0, the new stub code no longer handles null parameters.
Taken from the generated *MessageReceiverInOut.java:

if (gh.GetDisciplinesIndividuals.class.equals(type)){
  return gh.GetDisciplinesIndividuals.Factory.parse(param.getXMLStreamReaderWithoutCaching());
}

This code throws an nullpointerexception when our existing clients pass a request without a empty parameter node. eg.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:adm="http://gh.com">
   <soap:Header/>
   <soap:Body>
      <adm:getDisciplinesIndividuals/>
   </soap:Body>
</soap:Envelope>

While axis 1.6.0 does update the WSDL to require this parameter (shown below), this means that axis 1.6.0 is not backwards compatible with our existing clients (obviously a fairly large issue).

<wsdl:operation name="getDisciplinesIndividuals">
  <wsdl:input message="ns:getDisciplinesIndividualsRequest" wsaw:Action="urn:getDisciplinesIndividuals">
</wsdl:input>

...

<wsdl:message name="getDisciplinesIndividualsRequest">
  <wsdl:part name="parameters" element="ns:getDisciplinesIndividuals">
  </wsdl:part>
</wsdl:message>

Any suggestions how we can generate axis 1.6.0 stubs that will handle these null requests from existing clients?

Thanks

Leon Koch