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 Martin Hubley <mh...@espial.com> on 2002/06/12 15:41:09 UTC
java.util.Map, List with wingfoot SOAP client and Axis beta 2 ser
ver
Hi,
I noticed on compatibility test results on the wingfoot site that wingfoot
SOAP is shown as fully compatible with Apache Axis. I was wondering if
wingfoot soap1.02 with J2SE transport supports the use of Maps and Lists as
parameters and return types against Axis beta 2? I'm running Axis beta 2
and have a service published with the following interface:
public Map getProfile(String type, Map ids);
and when I run a wingfoot client making this call against Axis the following
SAXException occurs on the server:
[ERROR,AxisServlet] Exception:
org.xml.sax.SAXException: Bad types (null -> interface java.util.Map)
org.xml.sax.SAXException: Bad types (null -> interface java.util.Map)
at
org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:205)
at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Deserializa
tionContextImpl.java:831)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:199)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
589)
at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:190)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:248)
at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:1
50)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:262)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:154)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:121)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:288)
at
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:576)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
If I try to use a Hashtable as the actual value for the parameter passed
instead of a HashMap, I get a slightly different exception:
[ERROR,AxisServlet] Exception:
org.xml.sax.SAXException: Only ''item'' elements are allowed in a Map!
org.xml.sax.SAXException: Only ''item'' elements are allowed in a Map!
at
org.apache.axis.encoding.ser.MapDeserializer.onStartChild(MapDeserializer.ja
va:157)
at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Deserializa
tionContextImpl.java:831)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:199)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
589)
at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:190)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:248)
at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:1
50)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:262)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:154)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:121)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:288)
at
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:576)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
It seems in this case that wingfoot is using <mapitem> tags for each element
in the Hashtable, and Axis is expecting <item> tags?? Any help/suggestions
appreciated.
Thanks,
Martin Hubley
Re: [Wingfoot Interest Group] java.util.Map, List with wingfoot SOAP
client and Axis beta 2 server
Posted by Sam Ruby <ru...@us.ibm.com>.
Kal Iyer wrote:
>The Apache code does not check to see if the <key> and <value> is enclosed
>inside an <item> element. I have not looked at Axis code but judging from
>the error it looks like Axis dislikes if the <key> and <value> are enclosed
>in anything other than <item>. Wingfoot 1.02 serializes a Hashtable as
>follows:
>
><mapitem>
><key> theKey </key>
><value> theValue </value>
></mapitem>
>
>I am curious as to why Axis insists on an <item>. The other implementations
>on soapbuilders do not complain on seeing a <mapitem>
>
I checked again, and Apache SOAP did not enforce this. I find the
argument that such a check precludes interoperability with a released
version of another SOAP stack compelling and have gone ahead and made
the change to Axis.
- Sam Ruby
Re: [Wingfoot Interest Group] java.util.Map, List with wingfoot SOAP client and Axis beta 2 server
Posted by Kal Iyer <ka...@wingfoot.com>.
Sam:
The Apache code does not check to see if the <key> and <value> is enclosed
inside an <item> element. I have not looked at Axis code but judging from
the error it looks like Axis dislikes if the <key> and <value> are enclosed
in anything other than <item>. Wingfoot 1.02 serializes a Hashtable as
follows:
<mapitem>
<key> theKey </key>
<value> theValue </value>
</mapitem>
I am curious as to why Axis insists on an <item>. The other implementations
on soapbuilders do not complain on seeing a <mapitem>
Kal
----- Original Message -----
From: "Sam Ruby" <ru...@us.ibm.com>
To: <ax...@xml.apache.org>
Cc: <wi...@wingfoot.com>
Sent: Friday, June 21, 2002 3:21 AM
Subject: Re: [Wingfoot Interest Group] java.util.Map, List with wingfoot
SOAP client and Axis beta 2 server
> Kal Iyer wrote:
>
> > Thanks for pointing this out. I verified that Axis does complain it
> > each element of the Hashtable is decorated with mapitem instead of
> > item. I am baffled as to why it exhibits this behaviour (Apache does
> > not complain); we will change mapitem to item in our next release to
> > ensure full compatibility with Axis.
>
>
> I'm baffled too. Apache SOAP appears to have code that verifies that
> the names of the elements inside an <item> are <key> and <value>. See
>
http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apache/so
ap/encoding/soapenc/HashtableSerializer.java
>
> - Sam Ruby
>
>
> -------
> To unsubscribe from the mailing list, please send an email to
> majordomo@wingfoot.com with the following in the body
> unsubscribe wingfoot_interest_group
> -------
Re: [Wingfoot Interest Group] java.util.Map, List with wingfoot SOAP
client and Axis beta 2 server
Posted by Sam Ruby <ru...@us.ibm.com>.
Kal Iyer wrote:
> Thanks for pointing this out. I verified that Axis does complain it
> each element of the Hashtable is decorated with mapitem instead of
> item. I am baffled as to why it exhibits this behaviour (Apache does
> not complain); we will change mapitem to item in our next release to
> ensure full compatibility with Axis.
I'm baffled too. Apache SOAP appears to have code that verifies that
the names of the elements inside an <item> are <key> and <value>. See
http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apache/soap/encoding/soapenc/HashtableSerializer.java
- Sam Ruby
Re: [Wingfoot Interest Group] java.util.Map, List with wingfoot SOAP client and Axis beta 2 server
Posted by Kal Iyer <ka...@wingfoot.com>.
java.util.Map, List with wingfoot SOAP client and Axis beta 2 serverMartin:
Thanks for pointing this out. I verified that Axis does complain it each element of the Hashtable is decorated with mapitem instead of item. I am baffled as to why it exhibits this behaviour (Apache does not complain); we will change mapitem to item in our next release to ensure full compatibility with Axis.
Regards,
Kal
----- Original Message -----
From: Martin Hubley
To: 'wingfoot_interest_group@wingfoot.com'
Cc: axis-user@xml.apache.org
Sent: Wednesday, June 12, 2002 6:41 AM
Subject: [Wingfoot Interest Group] java.util.Map, List with wingfoot SOAP client and Axis beta 2 server
Hi,
I noticed on compatibility test results on the wingfoot site that wingfoot SOAP is shown as fully compatible with Apache Axis. I was wondering if wingfoot soap1.02 with J2SE transport supports the use of Maps and Lists as parameters and return types against Axis beta 2? I'm running Axis beta 2 and have a service published with the following interface:
public Map getProfile(String type, Map ids);
and when I run a wingfoot client making this call against Axis the following SAXException occurs on the server:
[ERROR,AxisServlet] Exception:
org.xml.sax.SAXException: Bad types (null -> interface java.util.Map)
org.xml.sax.SAXException: Bad types (null -> interface java.util.Map)
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:205)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:831)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:199)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:589)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:190)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:248)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:150)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:262)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:154)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:121)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:288)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:576)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
If I try to use a Hashtable as the actual value for the parameter passed instead of a HashMap, I get a slightly different exception:
[ERROR,AxisServlet] Exception:
org.xml.sax.SAXException: Only ''item'' elements are allowed in a Map!
org.xml.sax.SAXException: Only ''item'' elements are allowed in a Map!
at org.apache.axis.encoding.ser.MapDeserializer.onStartChild(MapDeserializer.java:157)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:831)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:199)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:589)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:190)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:248)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:150)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:262)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:154)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:121)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:288)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:576)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
It seems in this case that wingfoot is using <mapitem> tags for each element in the Hashtable, and Axis is expecting <item> tags?? Any help/suggestions appreciated.
Thanks,
Martin Hubley