You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Dallas007 <na...@gmail.com> on 2011/03/09 20:56:55 UTC

xml-version missing in REST (XML) message

Hi,
Xml-version missing in REST (XML) message. I have tried using below code but
that did not fix the problem. I can see xml start tag added to soap message
but it did not add to REST (XML) response. FYI, I am using cxf latest
version and JAXB.

       
PhaseInterceptorChain.getCurrentMessage().getExchange().put("org.apache.cxf.stax.force-start-document",
Boolean.TRUE); 


--
View this message in context: http://cxf.547215.n5.nabble.com/xml-version-missing-in-REST-XML-message-tp3416163p3416163.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF 2.3.3 with spring 2.5?

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 10 March 2011 7:00:46 PM Kessel, Christopher wrote:
> Our app is on Spring 2.5.4. Yea, I know it's old, but getting a chance to
> update core frameworks is difficult.
> 
> My question is, I see that CXF 2.3.3 uses in Spring 3 libraries. Does that
> mean I shouldn't integrate CXF 2.3.3 with a Spring 2.5 application? Well,
> at least not if I'm using spring configuration for cxf (e.g.
> <cxf:bus><cxf:features>....).

It may work fine.   We still have a profile that uses 2.5.6 and, while a 
couple tests fail, for the most part, it still works.  The problem tests are 
mostly around different behavior when the Application contexts are refreshed 
or closed.  If you are just starting up the app and leaving it, it should work 
fine.   If you are starting things up, refreshing the contexts, reloading 
beans, etc...  you may run into issues.


-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: xml-version missing in REST (XML) message

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

I've just checked JAXBElementProvider, the simplest way is to actually
register JAXBElementProvider explicitly (as a jaxrs:provider) and set the
"marshallerProperties" map property and set the "jaxb.fragment" there,
please check for an example:

http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-ConfiguringJAXBprovider

Or you can do it in the out CXF interceptor:

public class CustomOutInterceptor extends AbstractOutDatabindingInterceptor
{
    public CustomOutInterceptor() {
        super(Phase.MARSHAL);
    }

    public void handleMessage(Message message) {
        outMessage.put("jaxb.fragment", Boolean.FALSE);
    }
}

which will need to be registered in jaxrs:outInterceptors section

Cheers, Sergey

On Thu, Mar 10, 2011 at 10:17 PM, Dallas007 <na...@gmail.com> wrote:

> Thank you ,
> I have added below statement in my requestlogginginterceptor but it did not
> fix the problem.
>
> message.put(javax.xml.bind.Marshaller.*JAXB_FRAGMENT* , Boolean.*FALSE*);
>
> I have tried using below statement in my outer interceptor  too but that
> did
> not fix the problem..FYI, my outer interceptor class,
> *
>
> public* *class* OuterInterceptor *extends* LoggingOutInterceptor {
>
> /**
>
> * Override the logger to update the XML_LOG log
>
> * *@param* responseBody the response body to log
>
> * *@return* the response body.
>
> */
>
> @Override
>
> *protected* String transform(String responseBody) {
>
> //write out to XML LOG
>
>
>
> PhaseInterceptorChain.*getCurrentMessage*().put(javax.xml.bind.Marshaller.*
> JAXB_FRAGMENT*, Boolean.*TRUE*);
>
> tlog message
>
> *return* responseBody;
>
> }
>
> }
>
>
>
> On Thu, Mar 10, 2011 at 4:20 AM, Sergey Beryozkin-5 [via CXF] <
> ml-node+3423194-676140178-151593@n5.nabble.com> wrote:
>
> > Hi
> >
> > On Wed, Mar 9, 2011 at 10:51 PM, Dallas007 <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=3423194&i=0&by-user=t>>
> > wrote:
> >
> > > Yes I do use JAXRS.
> > >
> > >
> > You probably need to set the
> >
> > javax.xml.bind.Marshaller.JAXB_FRAGMENT ("jaxb.fragment") to
> Boolean.FALSE
> > in your custom CXF out interceptor.
> > This property has to be set on the out message, not on the exchange, you
> > can
> > do from the cxf interceptor or ResponseHandler filter...
> >
> > let me know please if it fixes it.
> >
> > Sergey
> >
> > On Wed, Mar 9, 2011 at 1:56 PM, Sergey Beryozkin-5 [via CXF] <
> >
> > > [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3423194&i=1&by-user=t>>
> > wrote:
> > >
> > > > Hi
> > > >
> > > > On Wed, Mar 9, 2011 at 7:56 PM, Dallas007 <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=3416352&i=0&by-user=t>>
> >
> > > > wrote:
> > > >
> > > > > Hi,
> > > > > Xml-version missing in REST (XML) message. I have tried using below
> > > code
> > > > > but
> > > > > that did not fix the problem. I can see xml start tag added to soap
> > > > message
> > > > > but it did not add to REST (XML) response. FYI, I am using cxf
> latest
> >
> > > > > version and JAXB.
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> PhaseInterceptorChain.getCurrentMessage().getExchange().put("org.apache.cxf.stax.force-start-document",
> >
> > > >
> > > > > Boolean.TRUE);
> > > > >
> > > > >
> > > > Do you use JAX-RS or not ?
> > > >
> > > > Cheers, Sergey
> > >
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://cxf.547215.n5.nabble.com/xml-version-missing-in-REST-XML-message-tp3416163p3423194.html
> >   To unsubscribe from xml-version missing in REST (XML) message, click
> > here<
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3416163&code=bmFuZGlnYW1hNHVAZ21haWwuY29tfDM0MTYxNjN8NTQ0NDQwNTcy
> >.
> >
> >
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/xml-version-missing-in-REST-XML-message-tp3416163p3424207.html
> Sent from the cxf-user mailing list archive at Nabble.com.




-- 
Sergey Beryozkin

Application Integration Division of Talend <http://www.talend.com>
http://sberyozkin.blogspot.com

RE: CXF 2.3.x and WS-SecureConversation protocol

Posted by "Muller, Anthony" <an...@sap.com>.
Thanks Denis for these interesting links. I'm looking for code samples from the second article.

If other documentations/tutorials/samples were available somewhere, it will be great because this subject is not very well covered :-/

Regards,
Anthony

From: Dennis Sosnoski [mailto:dms@sosnoski.com]
Sent: vendredi 11 mars 2011 12:07
To: users@cxf.apache.org
Cc: Muller, Anthony
Subject: Re: CXF 2.3.x and WS-SecureConversation protocol

Hi Anthony,

You can try out my CXF samples from the articles http://www.ibm.com/developerworks/java/library/j-jws15/index.html and http://www.ibm.com/developerworks/java/library/j-jws16/index.html I'm not sure exactly how the configuration would work for an applet client, but perhaps you can use the samples as a starting point.

  - Dennis

Dennis M. Sosnoski
Java SOA and Web Services Consulting<http://www.sosnoski.com/consult.html>
Axis2/CXF/Metro SOA and Web Services Training<http://www.sosnoski.com/training.html>
Web Services Jump-Start<http://www.sosnoski.com/jumpstart.html>

On 03/11/2011 10:46 PM, Muller, Anthony wrote:

Hello,



I'm looking for a way to secure exchanges between an applet (based on Java 6 without any CXF jars) and a SOAP webservice based on CXF.



I read about WS-SecureConversation on the CXF website but it's not enough in my case:

http://cxf.apache.org/docs/ws-secureconversation.html



Please, could you explain me how can I find more materials in order to configure the applet code and CXF webservice properly?



I think, in my use case, the security context would be created by the server-side (webservice) or maybe by negociation...



Thanks and regards,

Anthony





Re: CXF 2.3.x and WS-SecureConversation protocol

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Hi Anthony,

You can try out my CXF samples from the articles
http://www.ibm.com/developerworks/java/library/j-jws15/index.html and
http://www.ibm.com/developerworks/java/library/j-jws16/index.html I'm
not sure exactly how the configuration would work for an applet client,
but perhaps you can use the samples as a starting point.

  - Dennis

Dennis M. Sosnoski
Java SOA and Web Services Consulting <http://www.sosnoski.com/consult.html>
Axis2/CXF/Metro SOA and Web Services Training
<http://www.sosnoski.com/training.html>
Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>


On 03/11/2011 10:46 PM, Muller, Anthony wrote:
> Hello,
>
> I'm looking for a way to secure exchanges between an applet (based on Java 6 without any CXF jars) and a SOAP webservice based on CXF.
>
> I read about WS-SecureConversation on the CXF website but it's not enough in my case:
> http://cxf.apache.org/docs/ws-secureconversation.html
>
> Please, could you explain me how can I find more materials in order to configure the applet code and CXF webservice properly?
>
> I think, in my use case, the security context would be created by the server-side (webservice) or maybe by negociation...
>
> Thanks and regards,
> Anthony
>
>   

CXF 2.3.x and WS-SecureConversation protocol

Posted by "Muller, Anthony" <an...@sap.com>.
Hello,

I'm looking for a way to secure exchanges between an applet (based on Java 6 without any CXF jars) and a SOAP webservice based on CXF.

I read about WS-SecureConversation on the CXF website but it's not enough in my case:
http://cxf.apache.org/docs/ws-secureconversation.html

Please, could you explain me how can I find more materials in order to configure the applet code and CXF webservice properly?

I think, in my use case, the security context would be created by the server-side (webservice) or maybe by negociation...

Thanks and regards,
Anthony

CXF 2.3.3 with spring 2.5?

Posted by "Kessel, Christopher" <ck...@transunion.com>.
Our app is on Spring 2.5.4. Yea, I know it's old, but getting a chance to update core frameworks is difficult.

My question is, I see that CXF 2.3.3 uses in Spring 3 libraries. Does that mean I shouldn't integrate CXF 2.3.3 with a Spring 2.5 application? Well, at least not if I'm using spring configuration for cxf (e.g. <cxf:bus><cxf:features>....).

Thanks,
Chris


Re: xml-version missing in REST (XML) message

Posted by Dallas007 <na...@gmail.com>.
Thank you ,
I have added below statement in my requestlogginginterceptor but it did not
fix the problem.

message.put(javax.xml.bind.Marshaller.*JAXB_FRAGMENT* , Boolean.*FALSE*);

I have tried using below statement in my outer interceptor  too but that did
not fix the problem..FYI, my outer interceptor class,
*

public* *class* OuterInterceptor *extends* LoggingOutInterceptor {

/**

* Override the logger to update the XML_LOG log

* *@param* responseBody the response body to log

* *@return* the response body.

*/

@Override

*protected* String transform(String responseBody) {

//write out to XML LOG



PhaseInterceptorChain.*getCurrentMessage*().put(javax.xml.bind.Marshaller.*
JAXB_FRAGMENT*, Boolean.*TRUE*);

tlog message

*return* responseBody;

}

}



On Thu, Mar 10, 2011 at 4:20 AM, Sergey Beryozkin-5 [via CXF] <
ml-node+3423194-676140178-151593@n5.nabble.com> wrote:

> Hi
>
> On Wed, Mar 9, 2011 at 10:51 PM, Dallas007 <[hidden email]<http://user/SendEmail.jtp?type=node&node=3423194&i=0&by-user=t>>
> wrote:
>
> > Yes I do use JAXRS.
> >
> >
> You probably need to set the
>
> javax.xml.bind.Marshaller.JAXB_FRAGMENT ("jaxb.fragment") to Boolean.FALSE
> in your custom CXF out interceptor.
> This property has to be set on the out message, not on the exchange, you
> can
> do from the cxf interceptor or ResponseHandler filter...
>
> let me know please if it fixes it.
>
> Sergey
>
> On Wed, Mar 9, 2011 at 1:56 PM, Sergey Beryozkin-5 [via CXF] <
>
> > [hidden email]<http://user/SendEmail.jtp?type=node&node=3423194&i=1&by-user=t>>
> wrote:
> >
> > > Hi
> > >
> > > On Wed, Mar 9, 2011 at 7:56 PM, Dallas007 <[hidden email]<
> > http://user/SendEmail.jtp?type=node&node=3416352&i=0&by-user=t>>
>
> > > wrote:
> > >
> > > > Hi,
> > > > Xml-version missing in REST (XML) message. I have tried using below
> > code
> > > > but
> > > > that did not fix the problem. I can see xml start tag added to soap
> > > message
> > > > but it did not add to REST (XML) response. FYI, I am using cxf latest
>
> > > > version and JAXB.
> > > >
> > > >
> > > >
> > > >
> > >
> >
> PhaseInterceptorChain.getCurrentMessage().getExchange().put("org.apache.cxf.stax.force-start-document",
>
> > >
> > > > Boolean.TRUE);
> > > >
> > > >
> > > Do you use JAX-RS or not ?
> > >
> > > Cheers, Sergey
> >
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/xml-version-missing-in-REST-XML-message-tp3416163p3423194.html
>   To unsubscribe from xml-version missing in REST (XML) message, click
> here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3416163&code=bmFuZGlnYW1hNHVAZ21haWwuY29tfDM0MTYxNjN8NTQ0NDQwNTcy>.
>
>


--
View this message in context: http://cxf.547215.n5.nabble.com/xml-version-missing-in-REST-XML-message-tp3416163p3424207.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: xml-version missing in REST (XML) message

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On Wed, Mar 9, 2011 at 10:51 PM, Dallas007 <na...@gmail.com> wrote:

> Yes I do use JAXRS.
>
>
You probably need to set the

javax.xml.bind.Marshaller.JAXB_FRAGMENT ("jaxb.fragment") to Boolean.FALSE
in your custom CXF out interceptor.
This property has to be set on the out message, not on the exchange, you can
do from the cxf interceptor or ResponseHandler filter...

let me know please if it fixes it.

Sergey

On Wed, Mar 9, 2011 at 1:56 PM, Sergey Beryozkin-5 [via CXF] <
> ml-node+3416352-110167760-151593@n5.nabble.com> wrote:
>
> > Hi
> >
> > On Wed, Mar 9, 2011 at 7:56 PM, Dallas007 <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=3416352&i=0&by-user=t>>
> > wrote:
> >
> > > Hi,
> > > Xml-version missing in REST (XML) message. I have tried using below
> code
> > > but
> > > that did not fix the problem. I can see xml start tag added to soap
> > message
> > > but it did not add to REST (XML) response. FYI, I am using cxf latest
> > > version and JAXB.
> > >
> > >
> > >
> > >
> >
> PhaseInterceptorChain.getCurrentMessage().getExchange().put("org.apache.cxf.stax.force-start-document",
> >
> > > Boolean.TRUE);
> > >
> > >
> > Do you use JAX-RS or not ?
> >
> > Cheers, Sergey
>

Re: xml-version missing in REST (XML) message

Posted by Dallas007 <na...@gmail.com>.
Yes I do use JAXRS.

On Wed, Mar 9, 2011 at 1:56 PM, Sergey Beryozkin-5 [via CXF] <
ml-node+3416352-110167760-151593@n5.nabble.com> wrote:

> Hi
>
> On Wed, Mar 9, 2011 at 7:56 PM, Dallas007 <[hidden email]<http://user/SendEmail.jtp?type=node&node=3416352&i=0&by-user=t>>
> wrote:
>
> > Hi,
> > Xml-version missing in REST (XML) message. I have tried using below code
> > but
> > that did not fix the problem. I can see xml start tag added to soap
> message
> > but it did not add to REST (XML) response. FYI, I am using cxf latest
> > version and JAXB.
> >
> >
> >
> >
> PhaseInterceptorChain.getCurrentMessage().getExchange().put("org.apache.cxf.stax.force-start-document",
>
> > Boolean.TRUE);
> >
> >
> Do you use JAX-RS or not ?
>
> Cheers, Sergey
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/xml-version-missing-in-REST-XML-message-tp3416163p3416352.html
> To unsubscribe from xml-version missing in REST (XML) message, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3416163&code=bmFuZGlnYW1hNHVAZ21haWwuY29tfDM0MTYxNjN8NTQ0NDQwNTcy>.
>
>


--
View this message in context: http://cxf.547215.n5.nabble.com/xml-version-missing-in-REST-XML-message-tp3416163p3418880.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: xml-version missing in REST (XML) message

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On Wed, Mar 9, 2011 at 7:56 PM, Dallas007 <na...@gmail.com> wrote:

> Hi,
> Xml-version missing in REST (XML) message. I have tried using below code
> but
> that did not fix the problem. I can see xml start tag added to soap message
> but it did not add to REST (XML) response. FYI, I am using cxf latest
> version and JAXB.
>
>
>
> PhaseInterceptorChain.getCurrentMessage().getExchange().put("org.apache.cxf.stax.force-start-document",
> Boolean.TRUE);
>
>
Do you use JAX-RS or not ?

Cheers, Sergey