xfire调用webservice[#document: null]问题
xfire 调用.net webservice的时候返回[#document: null]这个事怎么回事呀? ? ? 返回的是org.apache.xerces.dom.DocumentImpl,你也可以强制转换为w3c的document。 java操作xml: try { ??????????? Client client = new Client(new URL("http://www.webxml.com.cn/webservices/ChinaTVprogramWebService.asmx?wsdl")); ??????????? Object[] results = client.invoke("getTVchannelString",new Integer[]{2}); ??????????? System.out.println(results[0]); ??????????? Document d = (Document)results[0]; ??????????? System.out.println(d.getFirstChild()); ??????????? NodeList nl =d.getElementsByTagName("getTVchannelStringResult"); ??????????? NodeList n2 = nl.item(0).getChildNodes(); ??????????? System.out.println(n2.getLength()); ??????????? for (int i=0;i<n2.getLength();i++){ ??????????? ??? System.out.println(n2.item(i).getNodeName()+"::"+n2.item(i).getTextContent()); ??????????? ??? ??????????? } ?????????? ???? } catch (MalformedURLException e) { ??????????? e.printStackTrace(); ???? } catch (Exception e) { ??????????? // TODO Auto-generated catch block ??????????? e.printStackTrace(); ???? } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |