You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Yong Zhou <ic...@gmail.com> on 2017/01/26 01:54:59 UTC

Same namespace of different server versions

Hi,

We are using Axis client 1.4 in our server to call a remote server. The
server publishes two versions (v6.0 and v6.2) of WSDL with same namespace.

https://ss.yahooapis.jp/services/V6.0/AdGroupAdService?wsdl
https://ss.yahooapis.jp/services/V6.2/AdGroupAdService?wsdl

Our server supports both v6.0 and v6.2 traffic with the remote server. The
problem comes when
1, a v6.0 request is sent and processed successfully.
2, a v6.2 request is sent and processed successfully.
3, then a v6.0 request fails with

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.yahoo.yahoojapan.v6.AdGroupAdServiceSoapBindingStub.mutate(AdGroupAdServiceSoapBindingStub.java:447)

It seems like the root cause is around the singleton TypeMappingImpl. It
caches

    private Map qName2Pair;     // QName to Pair Mapping
    private Map class2Pair;     // Class Name to Pair Mapping
    private Map pair2SF;        // Pair to Serialization Factory
    private Map pair2DF;        // Pair to Deserialization Factory

and v6.2 name+class pair overrides qName mapping in qName2Pair, which
happens in step2.

Then in step3, v6.2 deserializer is returned for a v6.0 qName (same name in
the same namespace), and NPE is thrown when setting deserialized v6.2 object
to a v6.0 placeholder object.

The ideas we have now are:
1, find a way to make TypeMappingImpl not singleton, and always construct a
new instance for it for each call.
2, provide customized deserializer, which is an adaptor that chooses the
right version of deserializer.
3, maybe Axis2 already solve the issue?

Could you share any insights? Thanks!!

Yong