axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aravind Nallan" <aravind.nal...@openwave.com>
Subject RE: returning Map objects from webservices
Date Thu, 27 May 2004 19:10:29 GMT
Got it. Yes the RI maps it to java.util.Map.

Do i have to register this type with axis in my client before i use it? I
get the following exception trying to deserialize a response.

org.xml.sax.SAXException: No deserializer defined for array type
{http://java.sun.com/jax-rpc-ri/internal}mapEntry
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
        at org.apache.axis.client.Call.invoke(Call.java:2275)
        at org.apache.axis.client.Call.invoke(Call.java:2171)
        at org.apache.axis.client.Call.invoke(Call.java:1691)
        at
opwv.UserPreferencesBindingStub.getPreferences(UserPreferencesBindingStub.ja
va:245)
        at GalleryClient.main(GalleryClient.java:46)
Caused by: org.xml.sax.SAXException: No deserializer defined for array type
{http://java.sun.com/jax-rpc-ri/internal}mapEntry
        at
org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeseriali
zer.java:304)
        at
org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java
:428)
        at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Deserializa
tionContextImpl.java:976)
        at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
        at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
722)
        at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
        at org.apache.axis.client.Call.invoke(Call.java:2272)

even though the MapEntry class generated by wsdl2java is in classpath and
has getSerializer and getDeserializer methods which return BeanSerializer
objects.

Thanks
Aravind

-----Original Message-----
From: Tom Jordahl [mailto:tomj@macromedia.com]
Sent: Thursday, May 27, 2004 11:43 AM
To: 'axis-dev@ws.apache.org'
Subject: RE: returning Map objects from webservices



Yes, because there is no 'standard' Qualified name for the Java Map type.
So WSDL2Java is just creating a type based on the XML Schema in the WSDL.

Since the namespace is http://java.sun.com/jax-rpc-ri/internal, this gets
turned in to the package name "com.sun.java.jax_rpc_ri.internal".

I'll bet that the RI recognizes this QName and turns it in to a
java.utils.Map type (HashMap?)

I think we do similar things with Map Schema we emit in the axis.apache.org
namespace.....

--
Tom Jordahl
Macromedia Server Development

-----Original Message-----
From: Aravind Nallan [mailto:aravind.nallan@openwave.com]
Sent: Thursday, May 27, 2004 12:26 PM
To: axis-dev@ws.apache.org
Subject: returning Map objects from webservices

I'm trying to generate java code from the attached wsdl. WSDL2Java creates
the following code

package opwv;

public interface UserPreferences extends java.rmi.Remote {
    public com.sun.java.jax_rpc_ri.internal.MapEntry[]
getPreferences(opwv.Crede
ntials credentials_1, java.lang.String string_2, java.lang.String[]
arrayOfStrin
g_3) throws java.rmi.RemoteException, opwv.MMSException,
opwv.InvalidArgumentExc
eption, opwv.InvalidCredentialsException, opwv.UserAccountException;
    public void updatePreferences(opwv.Credentials credentials_1,
java.lang.Stri
ng string_2, com.sun.java.jax_rpc_ri.internal.MapEntry[] map_3) throws
java.rmi.
RemoteException, opwv.MMSException, opwv.InvalidArgumentException,
opwv.InvalidC
redentialsException, opwv.UserAccountException;
}

It creates type com.sun.java.jax_rpc_ri.internal.MapEntry[] for Maps. Is my
implementation supposed to use this internal jaxrpc type instead of regular
java.util.Map?

Thanks
Aravind


Mime
View raw message