<application xmlns="http://wadl.dev.java.net/2009/02" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <grammars/> <resources base="http://192.168.59.103:8181/cxf/annotator"> <resource path="/"> <resource path="annotate"> <method name="POST"> <request> <representation mediaType="multipart/mixed"> <param name="text" style="query" type="xs:anyType"/> </representation> </request> <response> <representation mediaType="application/json"/> <representation mediaType="application/x-jackson-smile"/> </response> </method> </resource> <resource path="annotatePlain"> <method name="POST"> <request> <representation mediaType="text/plain"> <param name="request" style="plain" type="xs:string"/> </representation> </request> <response> <representation mediaType="application/json"/> </response> </method> </resource> </resource> </resources> </application>
On Wed, Jul 29, 2015 at 2:07 PM, Benson Margulies <[email protected]> wrote: > Here's the perplexing wadl... > > On Wed, Jul 29, 2015 at 2:03 PM, Benson Margulies <[email protected]> > wrote: >> The WADL for this shows only one parameter. Did I miss something? >> >> >> @POST >> @Consumes("multipart/mixed") >> @Produces({"application/json", "application/x-jackson-smile"}) >> @Path("annotate") >> public Response annotate( >> @Multipart(value = "options", type = "application/json") >> Map<String, String> options, >> @Multipart(value = "text") InputStream text) throws IOException, >> RosetteException { >> >> final ObjectMapper mapper = getMapper(); >> AnnotatedText inputText = mapper.readValue(text, AnnotatedText.class); >> final AnnotatedText result = >> pipeline.createAnnotator().annotate(inputText); >> >> StreamingOutput stream = new StreamingOutput() { >> @Override >> public void write(OutputStream os) throws IOException, >> WebApplicationException { >> mapper.writeValue(os, result); >> } >> }; >> return Response.ok(stream).build(); >> }
