SOAP客户端对JAVA中给定WSDL的奇怪响应

SOAP客户端对JAVA中给定WSDL的奇怪响应,java,soap,wsdl,Java,Soap,Wsdl,好的,我必须为JAVA中给定的WSDL创建一个SOAP客户端,正如标题所说的。 现在我用NetBeans构建它,问题是当我运行它并放入我想要的IP时,我会得到以下响应 “net.webservicex。GeoIP@564809be" 我在他们的站点上测试了WSDL,对于相同的IP,我得到了以下结果 <GeoIP xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2

好的,我必须为JAVA中给定的WSDL创建一个SOAP客户端,正如标题所说的。 现在我用NetBeans构建它,问题是当我运行它并放入我想要的IP时,我会得到以下响应 “net.webservicex。GeoIP@564809be"

我在他们的站点上测试了WSDL,对于相同的IP,我得到了以下结果

<GeoIP xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.webservicex.net/">
<ReturnCode>1</ReturnCode>
<IP>178.128.33.188</IP>
<ReturnCodeDetails>Success</ReturnCodeDetails>
<CountryName>Greece</CountryName>
<CountryCode>GRC</CountryCode>
</GeoIP>

net.webservicex。GeoIP@564809be


您似乎正在打印对象的引用(
net.webservicex.GeoIP
尚未覆盖
toString
)。他们不是有一些
字符串getIP()
来获取IP吗

以下工作

GeoIPService ipService = new GeoIPService();
GeoIPServiceSoap geoIPServiceSoap = ipService.getGeoIPServiceSoap();
GeoIP geoIp = geoIPServiceSoap.getGeoIP("10.34.55.1");
System.out.println(geoIp.getCountryName());

请提供您正在运行的代码,这可能会有帮助。只是…谢谢你的时间不是我看到的…我张贴了上面的客户代码,如果它helps@LefterisD.Lalos:您正在打印
GeoIP
@LefterisD。Lalos:我的意思是您应该使用相应的getter来打印信息,而不是我希望看到的IP地址,而是IP地址的国家/地区。我对肥皂还不熟悉,所以如果有什么事情很明显而我看不到,我很抱歉it@LefterisD.Lalos:这与
SOAP
无关。您正在执行
System.out.println(GeoIP)
。这使用默认的
对象.toString()
它打印对象的参考信息。您应该使用
GeoIP
提供的每个相应的
getter
来查看感兴趣的信息
GeoIPService ipService = new GeoIPService();
GeoIPServiceSoap geoIPServiceSoap = ipService.getGeoIPServiceSoap();
GeoIP geoIp = geoIPServiceSoap.getGeoIP("10.34.55.1");
System.out.println(geoIp.getCountryName());