Aufrufen von REST-web-service-URL aus dem browser

Habe ich bereitgestellt, die einfache REST-Schnittstelle. Können sagen, meine REST-Dienst bereitgestellt wird, in diesem Kontext-Pfad:

http://localhost:8080/Engine/services/Evaluation

Dann rufe ich die URL wie diese:

http://localhost:8080/Engine/services/Evaluation?_wadl

Sehe ich die XML-Ausgabe:

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

Sich die Frage, wie die Methode aufrufen mit der URL aus dem browser?

Habe ich versucht zu geben:

http://localhost:8080/Engine/services/Evaluation/initializeEvaluation?localeCode=en-GB

Aber ich habe:

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

Ich bin sehr neu auf REST aber soweit ich das verstanden habe sollte die URL wie oben. Warum dann bin ich immer und Ausnahme?

Meine java-Schnittstelle:

@Path("/Evaluation/")
@Produces(MediaType.APPLICATION_JSON)
public interface EvaluationService {

    @GET
    @Path("initializeEvaluation/{localeCode}")
    EvaluationStatus initializeEvaluation(ClientType client, @PathParam("localeCode") String localeCode)
            throws EvaluationException;

}

Ich bin mit Apache CXF 2.7.0, JDK 1.7, Tomcat 7.

@Path("initializeEvaluation/{localeCode}") zu @Path("\initializeEvaluation/{localeCode}")
Immer syntax-Fehler über das falsche Zeichen: `\`.
seine @Path("/initializeEvaluation/{localeCode}")
Web-Services und WADL sind nichts zu tun mit dem REST. Jim, bitte Lesen Sie diese: roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven und hier: nordsc.com/ext/classification_of_http_based_apis.html

InformationsquelleAutor | 2013-01-30

Schreibe einen Kommentar