问题描述
我试图运行以下Java EE Web服务客户端几天:
package servclient;
import tuto.helloserv.HelloService;
import javax.xml.ws.WebServiceRef;
public class ServClient {
@WebServiceRef(wsdlLocation = "http://localhost:1991/HelloService/HelloService?wsdl")
public static HelloService helloServ;
public static void main(String[] args) {
System.out.println(webCall("world"));
}
private static String webCall(java.lang.String arg0) {
tuto.helloserv.Hello port = helloServ.getHelloPort();
return port.webCall(arg0);
}
}
但是,即使Web服务url为true,我在netbeans上也会遇到以下错误;
Exception in thread "main" java.lang.NullPointerException
at servclient.ServClient.webCall(ServClient.java:25)
at servclient.ServClient.main(ServClient.java:21)
C:\Users\DevShop\Documents\wapps\ServClient\nbproject\build-impl.xml:1329: The following error occurred while executing this line:
C:\Users\DevShop\Documents\wapps\ServClient\nbproject\build-impl.xml:981: Java returned: 1
BUILD FAILED (total time: 1 second)
我在机器上运行Java 1.8.0_261,但在任何已知论坛中都找不到任何明确的解决方案。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)