开发者

Java Axis Webservice stub throwing a NoEndPointException

开发者 https://www.devze.com 2022-12-17 23:49 出处:网络
I am consuming a web-service with axis. I am getting a NoEndpointException from any webservice method I call.

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 som开发者_StackOverflow社区ething is wrong with this. Do I need to pass in the webservice address? It already appears to be integrated into the stubs.


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();
0

精彩评论

暂无评论...
验证码 换一张
取 消