xfire调用webservice返回的结果怎么取到呀,现在调用 有有关问题吗

xfire调用webservice返回的结果如何取到呀,现在调用 有问题吗?
xfire调用webservice返回的结果如何取到呀,现在调用 有问题吗?
try {
Client c = new Client(new URL("http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx?wsdl"));
Object[] params = new Object[2];
params[0] = "1.202.90.134";
Object[] results = c.invoke("getCountryCityByIp",params);
Document d = (Document)results[0];
System.out.println(d.getNodeValue());
System.out.println(results[0]);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

------解决方案--------------------
public static void main(String[] args) {
String url="http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx";
String soapPre="http://WebXml.com.cn/"; 
 try{
    Service service=new Service();
    Call call=(Call)service.createCall();            
            call.setTargetEndpointAddress(new java.net.URL(url));       
            call.setOperationName(new QName(soapPre,"getCountryCityByIp")); 
            call.addParameter(new QName(soapPre,"theIpAddress"), org.apache.axis.encoding.XMLType.XSD_STRING,
                    javax.xml.rpc.ParameterMode.IN);
            call.setReturnType(new QName(soapPre,"getCountryCityByIp"),Vector.class);    
            call.setUseSOAPAction(true);
            call.setSOAPActionURI(soapPre + "getCountryCityByIp");    
                        
            Vector<String> v=(Vector<String>)call.invoke(new Object[]{"1.202.90.134"});
            System.out.println("***************");
            for(int i=0;i<v.size();i++)
            {
                System.out.println(v.get(i));
            }     
            System.out.println("***************");
 
 }catch (Exception  e){
 e.printStackTrace();
 }

***************
1.202.90.134
北京市 电信
***************




------解决方案--------------------
引用:
Quote: 引用:



Document document = (Document)object[0];
document.getElementsByTagName("要查找的节点名称").item(i).getTextContent();


返回的是一个xml ,你用 org.w3c.dom.Document 这个包就可以了。试试行不行!xfire调用webservice返回的结果怎么取到呀,现在调用 有有关问题吗

已经搞定谢谢
xfire调用webservice返回的结果怎么取到呀,现在调用 有有关问题吗  那就结贴给分吧。