0 Replies Latest reply on Mar 17, 2006 5:48 PM by Zoharat Bhiwandiwala

    RemoteException , trying to return Maps

    Zoharat Bhiwandiwala Newbie

      Hi,
      I have a web service which has been deployed on jboss-4.0.3SP1. The web service contains the following method call

      public Map<String, UserObject> getUserMap(Integer size){
      Map<String,UserObject> map = new HashMap<String,UserObject>();
      UserObject u = null;
      for(int i=0;i<size.intValue();i++){
      u = new UserObject();
      u.setName("Test" + i);
      map.put("key" + i, u);
      }
      return map;
      }.

      I created a WSDL file using rpc/encoded and also created the required ties using wscompile gen:server.

      Next I created a static client using wscompile gen:client.

      All methods work fine except for the one with the Map in it.

      I get the following exception.


      java.rmi.RemoteException: Runtime exception; nested exception is:
      deserialization error: unexpected element type: expected=, actual={http://xml.apache.org/xml-soap}Map
      at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:318)
      at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:300)
      at complex_stub.WebServiceIntf_Stub.getUserMap(WebServiceIntf_Stub.java:374)
      at com.docfinity.client.TestClient.main(TestClient.java:81)
      Caused by: deserialization error: unexpected element type: expected=, actual={http://xml.apache.org/xml-soap}Map
      at com.sun.xml.rpc.encoding.SOAPDeserializationContext.deserializeMultiRefObjects(SOAPDeserializationContext.java:90)
      at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:226)
      ... 2 more.


      The same web service when deployed on the Sun App server in the exact same way works fine. Please help I really need to get this working on the JBoss server.