You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ted Roeloffzen <te...@gmail.com> on 2013/11/14 12:15:20 UTC

SOAPMessage is null

Hi all

But now I'm having a problem.
I'm doing a little coding by example, so don't shoot me if i'm doing
something stupid ;)

In the interceptor i do the following:
SOAPMessage sm = message.getContent(SOAPMessage.class);

But sm will be null.

How is this possible and what am i doing wrong?
Is there a problem with the xml that i'm getting or is it something i'm
doing wrong?

kind regards,

Ted

Re: SOAPMessage is null

Posted by Mark Streit <mc...@gmail.com>.
Glenn Mazza's Weblog is usually a great resource for many such topics...
Perhaps these will help:

http://www.jroller.com/gmazza/entry/blog_article_index

http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors


On Friday, November 15, 2013, Ted Roeloffzen wrote:

> Thanks Aki,
>
> I'll try to add the SAAJInterceptor.
> But in this case i need to read the SOAPHeader and in the response-message
> i need to add some things to the SOAPHeader.
> Therefore i thought it was the easy way to have the SOAPMessage.
>
> kind regards,
>
> Ted
>
>
> 2013/11/14 Aki Yoshida <elakito@gmail.com <javascript:;>>
>
> > when no saaj interceptor (ie.,
> > org.apache.cxf.binding.soap.saaj.SAAJInInterceptor or
> > org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor)
> > is executed, a SOAPMessage instance is not available.
> >
> > that means, you can use one of the saaj interceptors (by inserting it
> > in your interceptor chain or instantiating one within your custom
> > interceptor and execute it (call its handleMessage method) if
> > SOAPMessage isn't available (that means no one else added the saaj
> > interceptor to instantiate the SOAPMessage).
> >
> > but maybe, there may not another approach to do what you want to do
> > and in that case, you may not need SOAPMessage?
> >
> > regards, aki
> >
> >
> >
> > 2013/11/14 Ted Roeloffzen <ted.roeloffzen@gmail.com <javascript:;>>:
> > > Hi all
> > >
> > > But now I'm having a problem.
> > > I'm doing a little coding by example, so don't shoot me if i'm doing
> > > something stupid ;)
> > >
> > > In the interceptor i do the following:
> > > SOAPMessage sm = message.getContent(SOAPMessage.class);
> > >
> > > But sm will be null.
> > >
> > > How is this possible and what am i doing wrong?
> > > Is there a problem with the xml that i'm getting or is it something i'm
> > > doing wrong?
> > >
> > > kind regards,
> > >
> > > Ted
> >
>


-- 
Regards,

Mark

Sent from Gmail Mobile on iPhone

Re: SOAPMessage is null

Posted by Ted Roeloffzen <te...@gmail.com>.
Thanks Aki,

I'll try to add the SAAJInterceptor.
But in this case i need to read the SOAPHeader and in the response-message
i need to add some things to the SOAPHeader.
Therefore i thought it was the easy way to have the SOAPMessage.

kind regards,

Ted


2013/11/14 Aki Yoshida <el...@gmail.com>

> when no saaj interceptor (ie.,
> org.apache.cxf.binding.soap.saaj.SAAJInInterceptor or
> org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor)
> is executed, a SOAPMessage instance is not available.
>
> that means, you can use one of the saaj interceptors (by inserting it
> in your interceptor chain or instantiating one within your custom
> interceptor and execute it (call its handleMessage method) if
> SOAPMessage isn't available (that means no one else added the saaj
> interceptor to instantiate the SOAPMessage).
>
> but maybe, there may not another approach to do what you want to do
> and in that case, you may not need SOAPMessage?
>
> regards, aki
>
>
>
> 2013/11/14 Ted Roeloffzen <te...@gmail.com>:
> > Hi all
> >
> > But now I'm having a problem.
> > I'm doing a little coding by example, so don't shoot me if i'm doing
> > something stupid ;)
> >
> > In the interceptor i do the following:
> > SOAPMessage sm = message.getContent(SOAPMessage.class);
> >
> > But sm will be null.
> >
> > How is this possible and what am i doing wrong?
> > Is there a problem with the xml that i'm getting or is it something i'm
> > doing wrong?
> >
> > kind regards,
> >
> > Ted
>

Re: SOAPMessage is null

Posted by Aki Yoshida <el...@gmail.com>.
when no saaj interceptor (ie.,
org.apache.cxf.binding.soap.saaj.SAAJInInterceptor or
org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor)
is executed, a SOAPMessage instance is not available.

that means, you can use one of the saaj interceptors (by inserting it
in your interceptor chain or instantiating one within your custom
interceptor and execute it (call its handleMessage method) if
SOAPMessage isn't available (that means no one else added the saaj
interceptor to instantiate the SOAPMessage).

but maybe, there may not another approach to do what you want to do
and in that case, you may not need SOAPMessage?

regards, aki



2013/11/14 Ted Roeloffzen <te...@gmail.com>:
> Hi all
>
> But now I'm having a problem.
> I'm doing a little coding by example, so don't shoot me if i'm doing
> something stupid ;)
>
> In the interceptor i do the following:
> SOAPMessage sm = message.getContent(SOAPMessage.class);
>
> But sm will be null.
>
> How is this possible and what am i doing wrong?
> Is there a problem with the xml that i'm getting or is it something i'm
> doing wrong?
>
> kind regards,
>
> Ted