16

I am using Apache Axis to connect my Java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception:

org.apache.axis.ConfigurationException: No service named <web service name> is available

any idea?

4

5 回答 5

22

According to the documentation linked to by @arnonym, this exception is somewhat misleading. In the first attempt to find the service a ConfigurationException is thrown and caught. It is logged at DEBUG level by the ConfigurationException class. Then another attempt is made using a different method to find the service that may then succeed. The workaround for this is to just change the log level on the ConfigurationException class to INFO in your log4j.properties:

log4j.logger.org.apache.axis.ConfigurationException = INFO
于 2013-07-31T21:19:03.303 回答
2

Just a guess, but it looks like that error message is reporting that you've left the service name blank. I imagine the code that generates that error message looks like this:

throw new ConfigurationException("No service named" + serviceName + " is available");
于 2008-10-07T16:56:16.947 回答
1

It is an exception used by Axis' control flow.

http://wiki.apache.org/ws/FrontPage/Axis/DealingWithCommonExceptions --> org.apache.axis.ConfigurationException: No service named XXX is available

于 2011-06-27T16:45:09.527 回答
0

This is what my code looks like. It seems to work fine. Are you using a service locator or just creating your service?

SomeServiceLocator locator = new SomeServiceLocator();
SomeService service = null;
try
{
    service = locator.getSomeServiceImplPort();
}
catch (ServiceException e)
{
    e.printStackTrace();
}
于 2008-09-15T18:45:18.810 回答
0

I don't know what version of Axis you're using but I'm using Axis2 for both server and client and the Java2WSDL create a default endpoint for the service on localhost. If you create the client stub with WSDL2Java, the default constructor of the stub will then point to localhost. If the service is on other endpoint you must use the constructor with the endpoint as parameter... Maybe the problem is not that at all but as said on other answers, without the WSDL you're using as WSDL2Java input it's hard to say.

于 2008-10-14T11:48:12.700 回答