Hi,

I am working on a project where a 3rd party has a .NET environment running that 
is providing REST style services that send and receive XML over HTTP. My side 
of the project is actually in Java on a separate machine entirely and we are 
using CXF to talk to the services with the built in JAXB support as the 
provider.

By default CXF appears to set the "Content Type" header of an XML request to 
"application/xml". We have also tested adding an @Consumes annotation to the 
method and setting it to "text/xml" and everything works fine on the CXF side. 
This is not surprising as these are the acceptable types for XML.

However, now the .NET team is saying that it must be "text/plain"  instead 
otherwise their server will reject the request and they don't seem to be able 
to or know how to change this setup.

We tried using the @Consumes annotation and setting it to "text/plain" but not 
surprisingly CXF complains that it does not have a provider registered for that 
type.

So, two questions:

1. If it is possible at all, what would be the easiest way to configure CXF to 
send XML documents with a Content Type header of "text/plain"?
2. What are the implications of sending XML over HTTP using plain/text as the 
Content Type? Are there any subtle "gotchas", or is it no big deal?

Thanks

Reply via email to