Hi, I have a question on providers.  The code base I'm working on uses a 
subclass of AegisElementProvider.  I'm trying to add a new method to a service 
class where this provider is in play.  I want a very simple resource that 
allows one to POST any free-form XML document...like this:

@Path("/foo")
@Consumes(MediaType.APPLICATION.XML)
public Response postXml(String body) {
  ...
}

...and call it like this from curl:

curl -d "<xml>foo</xml>" -H "Content-Type: application/xml" -X POST 
"http://host/path/foo";

Unfortunately, the same service has another method on it that accepts a 
JAXB/typed XML document with namespaces, etc.  When I post to my method above, 
the Provider first gets the request, and tries to marshall it into some Java 
type, and the request fails -- seems it expecting a specific xsi:type

WARN  2011-12-01 01:49:46,640 [TypeUtil] xsi:type was not specified for 
top-level element xml
WARN  2011-12-01 01:49:46,648 [WebApplicationExceptionMapper] 
WebApplicationException has been caught : No mapping found for XML input.

So, my question is this: is there some way to easily bypass this Provider for 
this method, so I can post any content I want as application/xml and have it 
just converted to a String -- bypassing the whole JAXB process altogether?

Reply via email to