Saturday, February 04, 2006

Axis: WSDL styles and initialization exception

Which style of WSDL should I use?

By the way, if you are using Apache Axis (1.2.1) and have NoSuchMethodException likes these below, don't worry. It prints out the stack trace, but it is only a leftover code that doesn't indicate any bug (since the object is correctly instantiated after this stack trace is printed):

java.lang.NoSuchMethodException:
org.apache.axis.encoding.ser.ArrayDeserializerFactory
.create(java.lang.Class, javax.xml.namespace.QName)

java.lang.NoSuchMethodException:
org.apache.axis.encoding.ser.ArrayDeserializerFactory
.(java.lang.Class, javax.xml.namespace.QName)

Another lesson from using Axis and Eclipse Webtools is that, as a default behaviour, it accepts either the operation name or the part name as the root element for an operation call. I mean, if you have an operation named "CalculateTest", declared like this:

<wsdl:operation name="CalculateTest">
<wsdl:input message="tns:CalculateTestRequest"/>
<wsdl:output message="tns:CalculateTestResponse"/>
</wsdl:operation>

It will accept a SOAP call with "CalculateTest" or "CalculateTestRequest" elements. If any given element is not found in the operations hash (what happens when the element matches the operation name), Axis will search for matching root elements of operations (in this case, CalculateTestRequest), and it will work.
Post a Comment