Cannot initiate the type GeoIPService in Java

狂风中的少年 提交于 2019-12-24 12:11:45

问题


New to SOAP. Using Eclipse Mars with JDK 1.8 under Windows Vista.

I am using http://www.webservicex.net/ws/WSDetails.aspx?CATID=12&WSID=64

I get the following error: Cannot initiate the type GeoIPService. Any idea why?

import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import net.webservicex.www.GeoIP;
import net.webservicex.www.GeoIPService;
import net.webservicex.www.GeoIPServiceSoap;

public class IPLocationFinder {
public static void main(String[] args) throws ServiceException, RemoteException {
    if (args.length != 1) {
        System.out.println("You need to pass in one IP address");
    }
    else
    {
        String ipAddress = args[0];

        GeoIPService geoIPService = new GeoIPService(); //<== Cannot initiate the type GeoIPService
        GeoIPServiceSoap geoIPServiceSoap = geoIPService.getGeoIPServiceSoap();
        GeoIP geoIP = geoIPServiceSoap.getGeoIP(ipAddress);
        System.out.println( geoIP.getCountryName() );
    }
}}

来源:https://stackoverflow.com/questions/31829598/cannot-initiate-the-type-geoipservice-in-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!