问题
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