views:

231

answers:

1

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

Its 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.

+1  A: 

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();
Guillaume Alvarez