刚刚接触到这一块的东东,玩了一天了,也没有搞得很明白,只是会调用自己写的,可是怎么调用别人写的呢,高手指点,3q!

解决方案 »

  1.   

    http://topic.csdn.net/u/20100322/11/8309d6ac-176a-48f5-b106-a6542be250f9.html?24977
      

  2.   


    public String getCountryCityByIp(String ip) {
            
            String connectPoint = "http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx";        Service srvcModel = new ObjectServiceFactory()
                    .create(IpAddressSearchWebService.class);        XFireProxyFactory factory = new XFireProxyFactory();
            IpAddressSearchWebService srvc;
            
            try {
                
                srvc = (IpAddressSearchWebService) factory.create(srvcModel,
                        connectPoint);
                
                XFireProxy proxy = (XFireProxy) Proxy.getInvocationHandler(srvc);
                Client client = proxy.getClient();
                //client.setProperty("SOAPAction", "http://WebXml.com.cn/getVersionTime");
                client.setProperty("SOAPAction", "http://WebXml.com.cn/getCountryCityByIp");
                
                String ipDetail = srvc.getCountryCityByIp(ip);
                
                System.out.println(ipDetail);
                
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }        return null;
        }
      

  3.   

    client.setProperty("SOAPAction", "http://WebXml.com.cn/getCountryCityByIp");
    把这个注释不要!
    然后
    IpAddressSearchWebService是自定义接口,可查看wdsl
      

  4.   

    根据别人的wsdl地址产生客户端,直接调用即可