Hello Ranchers,
Need some help with an error related to AXIS webservice.
We have an integration with a third-party for tax calculation. Recently, they have asked us to upgrade to a newer version of their services. The new version of wsdl adds an array of jurisdiction objects. We are getting a NullPointerException when the Axis library tries to deserialize the response received for this new service. We are using Axis 1.4 library.
The error trace that I have attached is from a standalone
test program which I am using to debug the issue.
It appears that the error happens due to nested array of complex type objects. Somehow i feel that AXIS is unable to deserialize the response when it contains a nested array of complex objects.
I beleive this issue occurs when response is of type, Axis deserializer breaks after parsing the first <c:frtype> element.
<c:replyMessage>
<c:field1>abc</c:field1>
<c:taxReply>
<c:frItem id="0">
<c:frName>Apple</c:frName>
<c:frColor>Red</c:frColor>
<c:frTaste>abc</c:frTaste>
<c:frtype id="0">
<c:frName id="0">Type1</c:frName>
<c:frType id="0">absdf</c:frType>
<c:frDesc id="0">trfdgd</c:frDesc>
</c:frtype>
<c:frtype id="1">
<c:frName id="0">Type2</c:frName>
<c:frType id="0">abhg</c:frType>
<c:frDesc id="0">yiuhj</c:frDesc>
</c:frtype>
</c:frItem>
</c:taxReply>
</c:replyMessage>
5136 [main] DEBUG org.apache.axis.encoding.DeserializationContext - Popped element stack to org.apache.axis.message.MessageElement:item
5136 [main] DEBUG org.apache.axis.encoding.DeserializationContext - Exit: DeserializationContext::endElement()
5136 [main] DEBUG org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(exception00)
5136 [main] ERROR org.apache.axis.client.Call - Exception:
java.lang.NullPointerException
at org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:135)
at org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:249)
at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:509)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.provider.stub.ITransactionProcessorStub.runTransaction(ITransactionProcessorStub.java:2019)
at Sample.main(Sample.java:143)
AxisFault: java.lang.NullPointerException
Please let me know if you have seen any similar issues or have any ideas on why this could be happening. I have attached the sample response and the detailed logs with this post.
I found a couple of similar posts upon googling but none of them had any solutions.
https://coderanch.com/t/475583/java/Illegal-Argument-exception-consuming-WS
https://webcache.googleusercontent.com/search?q=cache:yR1hOs79sCIJ:https://groups.google.com/d/topic/comp.lang.java.programmer/OVpX8-YeFvU+&cd=3&hl=en&ct=clnk&gl=in
Thanks,
Tejas