Re: JAXBException when streaming XML response

2018-03-06 Thread doug-6
Thank you Colm. I extended the BinaryDataProvider[1] and added this provider
to my jaxrs:server. Success!

[1]
@Produces({"application/custom+xml"})
@Provider
public class StreamingXMLBinaryDataProvider extends BinaryDataProvider
{}




--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html


Re: JAXBException when streaming XML response

2018-03-05 Thread Colm O hEigeartaigh
Have you tried explicitly adding the BinaryDataProvider as a JAX-RS
provider? Here's an example that explicitly adds the JAXBElementProvider:

https://github.com/apache/cxf/blob/4aaba3503b926b43634a6977d0150e4fd4557aa1/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml#L67

Colm.

On Fri, Mar 2, 2018 at 11:35 PM, doug-6  wrote:

> I'm using CXF 3.1.7 to create a JAXRS service that uses  with
> no custom providers. I'm trying to send a stream of data back in the http
> response using content-type application/custom+xml. The http response
> entity
> is set to an instance of a class that implements
> javax.ws.core.StreamingOutput. When requesting this resource, I get a http
> 500 error that states "JAXBException occured: class com.MyStreamingOutput
> nor any of its super class is known to this context.
>
> I stepped thru CXF source code via remote debugger and see that the
> JAXBElementProvider is being chosen, likely because of  content-type
> application/custom+xml. If I change my http response to use  content-type
> application/customXml, the BinaryDataProvider is used and the response body
> is what is desired.
>
> However, I need to return content-type application/custom+xml. What is the
> best way to configure  so that content-type
> application/custom+xml can be returned using a http entity that implements
> javax.ws.core.StreamingOutput? I prefer not to use JAXB as I know the XML
> is
> valid/well-formed.
>
>
>
>
> --
> Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com


JAXBException when streaming XML response

2018-03-02 Thread doug-6
I'm using CXF 3.1.7 to create a JAXRS service that uses  with
no custom providers. I'm trying to send a stream of data back in the http
response using content-type application/custom+xml. The http response entity
is set to an instance of a class that implements
javax.ws.core.StreamingOutput. When requesting this resource, I get a http
500 error that states "JAXBException occured: class com.MyStreamingOutput
nor any of its super class is known to this context. 

I stepped thru CXF source code via remote debugger and see that the
JAXBElementProvider is being chosen, likely because of  content-type
application/custom+xml. If I change my http response to use  content-type
application/customXml, the BinaryDataProvider is used and the response body
is what is desired. 

However, I need to return content-type application/custom+xml. What is the
best way to configure  so that content-type
application/custom+xml can be returned using a http entity that implements
javax.ws.core.StreamingOutput? I prefer not to use JAXB as I know the XML is
valid/well-formed.




--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html