Java Axis Web 服务存根抛出 NoEndPointException

发布于 2024-08-18 09:50:04 字数 483 浏览 4 评论 0原文

我正在使用 axis 的网络服务。我从我调用的任何 Web 服务方法中收到 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);

我认为这有问题。我需要传入网络服务地址吗?它似乎已经集成到存根中。

I am consuming a web-service with axis. I am getting a NoEndpointException from any webservice method I call.

It's coming from this generated code.

if (super.cachedEndpoint == null) {
    throw new org.apache.axis.NoEndPointException();
}

So it seems to suggest I haven't set up the endpoint correctly.

This is how I've instantiated the stubs:

MyService_ServiceLocator myService_ServiceLocator = new MyService_ServiceLocator();
MyService_PortType webservice = new MYServiceSOAPStub(myService_ServiceLocator);

I assume something is wrong with this. Do I need to pass in the webservice address? It already appears to be integrated into the stubs.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一直在等你来 2024-08-25 09:50:04

这可能取决于 Axis 版本(我使用的是 1.4 版),但我建议您使用定位器中的 getYourPortType() 方法。您不必提供网络服务 URL(因为它存储在生成的文件中)。

使用您的示例,它会是这样的:

MyService_ServiceLocator myService_ServiceLocator = new MyService_ServiceLocator();
MyService_PortType webservice = myService_ServiceLocator.getMyService_PortType();

It might depends on Axis version (I'm using version 1.4) but I suggest you to use the getYourPortType() method from the locator. You won't have to give your webservice URL (as it is stored in the generated files).

Using your sample it would be something like that:

MyService_ServiceLocator myService_ServiceLocator = new MyService_ServiceLocator();
MyService_PortType webservice = myService_ServiceLocator.getMyService_PortType();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文