I got my web services working using I believe an 'old school' (java 1.4?)
method of building the services (java2wsdl etc)
Now the boss decided we should use the more lightweight 1.6 WsGen method.
I added in the standard cheesy main that allows the 1.6 jvm to run as a
lightweight server. I ran WsGen on the service
which made some class files in the jaxws subdirectory. All good.
Here's an except of the service:
@WebServicepublic class Snapshot { private static final Logger log =
Logger.getLogger(Snapshot.class); public Snapshot() { } @WebMethod
public String retrieveSurvey(String surveyTypeName, String surveyVersionName)
{ return (String) serviceWrapper(new SurveyFetcher(surveyTypeName,
surveyVersionName)); } @WebMethod public LoadResult
submitSurvey(SurveyAnswers surveyAnswers) { return (LoadResult)
serviceWrapper(new SurveyChecker(surveyAnswers)); }
public static void main(String[] args) {
Endpoint.publish("http://localhost:9090/snapshot", new Snapshot());
}
When I run the main from the IDE. It sits there and listens to port 9090. I
expect to be able to browse to http://localhost:9090/snapshot?wsdl and see a
wsdl.
Instead, I get the following in all cases:
<Exception>org.apache.axis2.AxisFault: The service cannot be found for the
endpoint reference (EPR) /services/ at
org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:65)
at org.apache.axis2.engine.Phase.invoke(Phase.java:334) at
org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251) at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:160) at
org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:135)
at
org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:130)
at org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:246)
at
org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:281)
at
org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:187)
at
org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:82)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)</Exception>I don't know why it is
referring to /services. The 'Hello World' test program I ran didn't.
I don't believe the web service is loaded properly. I have no idea why not. I
have tried lots of combinations of things. Nothing makes
a difference. Here's an except of the logs showing the web service container's
fixation with /services
2009-10-06 16:56:35,608 DEBUG [HttpListener-9090-1]
(DefaultConnectionListener.java:81) - Incoming HTTP connection from
/127.0.0.1:22952009-10-06 16:56:35,624 DEBUG [HttpListener-9090-1]
(DefaultConnectionListener.java:78) - Waiting for incoming HTTP
connection2009-10-06 16:56:35,624 DEBUG [HttpConnection-9090-1]
(HttpServiceProcessor.java:78) - New connection thread2009-10-06 16:56:35,639
DEBUG [HttpConnection-9090-1] (AxisHttpService.java:135) - Remote address of
the connection : 127.0.0.12009-10-06 16:56:35,639 DEBUG [HttpConnection-9090-1]
(AxisHttpConnectionImpl.java:139) - >> GET /services/ HTTP/1.12009-10-06
16:56:35,639 DEBUG [HttpConnection-9090-1] (AxisHttpConnectionImpl.java:141) -
>> Host: localhost:90902009-10-06 16:56:35,639 DEBUG [HttpConnection-9090-1]
(AxisHttpConnectionImpl.java:141) - >> User-Agent: Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.32009-10-06
16:56:35,639 DEBUG [HttpConnection-9090-1] (AxisHttpConnectionImpl.java:141) -
>> Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.82009-10-06
16:56:35,639 DEBUG [HttpConnection-9090-1] (AxisHttpConnectionImpl.java:141) -
>> Accept-Language: en-us2009-10-06 16:56:35,639 DEBUG [HttpConnection-9090-1]
(AxisHttpConnectionImpl.java:141) - >> Accept-Encoding: gzip,deflate2009-10-06
16:56:35,639 DEBUG [HttpConnection-9090-1] (AxisHttpConnectionImpl.java:141) -
>> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.72009-10-06 16:56:35,639 DEBUG
[HttpConnection-9090-1] (AxisHttpConnectionImpl.java:141) - >> Keep-Alive:
3002009-10-06 16:56:35,639 DEBUG [HttpConnection-9090-1]
(AxisHttpConnectionImpl.java:141) - >> Connection: keep-alive2009-10-06
16:56:35,655 DEBUG [HttpConnection-9090-1] (AxisHttpService.java:243) - Request
method: GET2009-10-06 16:56:35,655 DEBUG [HttpConnection-9090-1]
(AxisHttpService.java:244) - Target URI: /services/2009-10-06 16:56:35,655
DEBUG [HttpConnection-9090-1] (BuilderUtil.java:365) - Input contentType
(application/x-www-form-urlencoded)2009-10-06 16:56:35,655 DEBUG
[HttpConnection-9090-1] (BuilderUtil.java:381) - CharSetEncoding defaulted
(UTF-8)2009-10-06 16:56:35,655 DEBUG [HttpConnection-9090-1]
(RequestURIBasedServiceDispatcher.java:50) - [MessageContext:
logID=urn:uuid:CEFF3F714B8C44A6EB1254862595665] Checking for Service using
target endpoint address : /services/2009-10-06 16:56:35,655 DEBUG
[HttpConnection-9090-1] (Utils.java:201) -
parseRequestURLForServiceAndOperation : [/services/][/services]
Any ideas on what I am doing wrong?