[英]Axis web service client respnose HashMap
I am trying to consume a web service which returns a Java hash map, following is the code for that 我正在尝试使用返回Java哈希图的Web服务,以下是该代码
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. 返回的HashMap始终为空,我认为该轴不支持它。 Can anyone give me pointers where i can find how to consume a service in jdk 1.4 which returns a hashmap?
谁能给我指点我可以在其中找到如何使用jdk 1.4中返回哈希图的服务?
好的,通过将byte []序列化为ByteArrayOutputStream来返回来解决它,我检索了字节数组并将其转换回客户端的hashMap。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.