[英]Axis web service client respnose HashMap
我正在嘗試使用返回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 + "'");
返回的HashMap始終為空,我認為該軸不支持它。 誰能給我指點我可以在其中找到如何使用jdk 1.4中返回哈希圖的服務?
好的,通過將byte []序列化為ByteArrayOutputStream來返回來解決它,我檢索了字節數組並將其轉換回客戶端的hashMap。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.