SOAP新手。在Windows Vista下使用Eclipse Mars和JDK 1.8。
我正在使用http://www.webservicex.net/ws/WSDetails.aspx?CATID=12&WSID=64
我收到以下错误:无法启动GeoIPService类型。知道为什么吗?
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() );
}
}}