web服务Java Axis web服务存根引发NoEndPointException
我正在使用axis的web服务。我正在从我调用的任何webservice方法中获取NoEndpointException
它来自这个生成的代码
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
这似乎表明我没有正确设置端点
以下是我实例化存根的方式:
MyService_ServiceLocator myService_ServiceLocator = new MyService_ServiceLocator();
MyService_PortType webservice = new MYServiceSOAPStub(myService_ServiceLocator);
我想这有点问题。我需要输入webservice地址吗?它似乎已经被整合到存根中
# 1 楼答案
这可能取决于Axis版本(我使用的是1.4版),但我建议您使用定位器中的getYourPortType()方法。您不必给出您的webservice URL(因为它存储在生成的文件中)
用你的样本可以得出这样的结论: