You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Freeman Fang <fr...@gmail.com> on 2011/03/01 03:24:55 UTC

Re: Calling Interceptor chain directly

Hi,

Yeah, you can do it, you need build a PhaseInterceptorChain and add  
Interceptors what you want to use, then doInterceptor against your  
SoapMessage, some code like

PhaseInterceptorChain inChain = new  
PhaseInterceptorChain(pm.getInPhases());
List<Interceptor<? extends Message>> inList = new  
ArrayList<Interceptor<? extends Message>>();
inList.add(new Interceptor1());
inList.add(new Interceptor2());
...
inChain.add(inList);
inChain.doIntercept(soapMessage);

Freeman
On 2011-3-1, at 上午12:40, eaudet wrote:

> Hi,
> Is it possible to call the interceptor chain from a pojo? I want  
> Apache CXF
> to process my soap messages in non-server context. In other words, I  
> want to
> use CXF un/marshalling power but without calling a webservice  
> enpoint. I am
> reading about custom invokers. Am i reading the good thing?
>
> What I have from using wsdl2java tool is:
> Web service Consumer -> Enpoint -> Interceptor chain ->....
>
> What I want (no jetty or other web server):
> Pojo -> Interceptor chain ->.....
>
> Thanks,
> - Erick
>
> -- 
> View this message in context: http://cxf.547215.n5.nabble.com/Calling-Interceptor-chain-directly-tp3403562p3403562.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------

FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: Calling Interceptor chain directly

Posted by eaudet <ea...@jarics.com>.
Hi Freeman,
If you mean by "real invocation" calling my server implementation method,
this is exactly what I want. I don't want to change the original behavior of
the interceptor chain created by the wsdl2java tool. I just want to replace
the jetty trigger that will call the whole thing. I'm trying to call the
generated interceptor chain from a pojo.
- Erick

--
View this message in context: http://cxf.547215.n5.nabble.com/Calling-Interceptor-chain-directly-tp3403562p3408001.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Calling Interceptor chain directly

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

The wsdl2java tool just generate client&server side stub code for you,  
it's build time thing.
Interceptors is cxf run time thing.
The default PhaseInterceptorChain have all interceptors to do like  
unmarshall and service invocation, so if you want to customize the  
behavior of PhaseInterceptorChain(such as what you want is only  
marshal/unmarshal but no real invocation), then you need build  
PhaseInterceptorChain and add necessary interceptors yourself, the  
default PhaseInterceptorChain doesn't work in this case.

Freeman
On 2011-3-2, at 上午3:24, eaudet wrote:

> Is it possible to use the default PhaseInterceptorChain? I mean  
> after using
> the wsdl2java tool, I have a complete running client and server  
> classes. To
> my understanding, it has all the interceptors and unmarshalling etc  
> that I
> need. Can't I just create a main() method in a java class that will  
> call
> existing interceptors?
>
>
> -- 
> View this message in context: http://cxf.547215.n5.nabble.com/Calling-Interceptor-chain-directly-tp3403562p3405559.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------

FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: Calling Interceptor chain directly

Posted by eaudet <ea...@jarics.com>.
Is it possible to use the default PhaseInterceptorChain? I mean after using
the wsdl2java tool, I have a complete running client and server classes. To
my understanding, it has all the interceptors and unmarshalling etc that I
need. Can't I just create a main() method in a java class that will call
existing interceptors?


-- 
View this message in context: http://cxf.547215.n5.nabble.com/Calling-Interceptor-chain-directly-tp3403562p3405559.html
Sent from the cxf-user mailing list archive at Nabble.com.