I have deployed simple REST interface. Lets say my REST service is deployed in this context path:
http://localhost:8080/Engine/services/Evaluation
Then I invoke URL like this:
http://localhost:8080/Engine/services/Evaluation?_wadl
I can see the XML output:
<application>
<grammars/>
<resources base="http://localhost:8080/Engine/services/Evaluation">
<resource path="/Evaluation/">
<resource path="initializeEvaluation/{localeCode}">
<param name="localeCode" style="template" type="xs:string"/>
<method name="GET">
<request>
<representation mediaType="application/octet-stream"/>
</request>
<response>
<representation mediaType="application/json"/>
</response>
</method>
</resource>
</resource>
</resources>
</application>
The question is how to call the method with the URL from the browser?
I've tried to enter:
http://localhost:8080/Engine/services/Evaluation/initializeEvaluation?localeCode=en-GB
But I've got:
2013-01-30 11:22:13,477 [http-bio-8080-exec-3] WARN JAXRSInInterceptor - No root resource matching request path /Engine/services/Evaluation/initializeEvaluation has been found, Relative Path: /initializeEvaluation. Please enable FINE/TRACE log level for more details.
2013-01-30 11:22:13,479 [http-bio-8080-exec-3] WARN WebApplicationExceptionMapper - javax.ws.rs.NotFoundException
I am very new at REST but as far as I understand the URL should be like above. Why then I am getting and exception?
My java interface:
@Path("/Evaluation/")
@Produces(MediaType.APPLICATION_JSON)
public interface EvaluationService {
@GET
@Path("initializeEvaluation/{localeCode}")
EvaluationStatus initializeEvaluation(ClientType client, @PathParam("localeCode") String localeCode)
throws EvaluationException;
}
I am using Apache CXF 2.7.0, JDK 1.7, Tomcat 7.
@Path("initializeEvaluation/{localeCode}")to@Path("\initializeEvaluation/{localeCode}")@Path("/initializeEvaluation/{localeCode}")