I am trying to consume a web service which returns a Java hash map, following is the code for that
String endpoint =
"http://localhost:8080/eCWServices/StructSpeech/StructSpeech";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(new QName("http://ejb.ecw.com/", "parseNotes"));
call.addParameter("notes", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN);
call.addParameter("apuId", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN);
call.addParameter("providerId", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.SOAP_MAP);
HashMap ret = (HashMap) call.invoke(new Object[]{"","",""});
System.out.println("Sent 'Hello!', got '" + ret + "'");
The returned HashMap is always empty and I think that axis does not support it. Can anyone give me pointers where i can find how to consume a service in jdk 1.4 which returns a hashmap?
Ok, Solved it by returning a byte[] by serializing it to a ByteArrayOutputStream, I retrieve the byte array and convert it back to hashMap on client side.