You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Maatari <ok...@yahoo.fr> on 2010/12/01 02:33:18 UTC

Soap Intermdiaries and CXF

Dear All

Is there any facilities/helps provided by the framework to implement a soap
intermediary ?

I would like to implement an intermediary between a client and a service as
3 endpoint situated at different location. 


Many thanks
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3287079.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Soap Intermdiaries and CXF

Posted by devkatiyar <de...@gmail.com>.
Hi , 
I think you can Look at example in below link .

http://cxf.apache.org/docs/service-routing.html
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3287254.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Soap Intermdiaries and CXF

Posted by Christian Schneider <ch...@die-schneider.net>.
I just saw that the example is also present in the CXF examples. As Dan 
pointed me to it I thought he had done it for the Talend Service Factory 
specifically.
So no need to download the Talend stuff. You can find the example in the 
cxf distribution.

Christian


Am 14.01.2011 08:55, schrieb Christian Schneider:
> Hi Maatari,
>
> I do not know of any way to specify intermediaries in the wsdl (that 
> does not mean there is no way ;-).
>
> If I understood you correctly then you want your intermediary to kick 
> in for any service call. So what I would do is add the
> intermediary as an interceptor into the cxf bus. That means it is 
> called for any service call.
>
> In the interceptors documentation on the wiki there is a paragraph 
> "adding interceptors through configuration".
> http://cxf.apache.org/docs/interceptors.html
>
> If you use spring to configure cxf then this should help you. In any 
> case writing such an interceptor is not easy if you are not familiar 
> with the
> framework internals.
>
> Dan pointed me to an example inside the Talend Service Factory (Apache 
> Licensed).
> http://www.talend.com/download.php
> You need the Talend-SF-2.3.1 download.
>
> There is an example configuration_interceptor that shows how to plug 
> an interceptor into all service calls. The interceptor does gzip 
> compression / decompression. So this
> interceptor code is probably not so interesting for you. I guess you 
> rather would like to write your interceptor in  a way to work on the 
> dom document like Dan described in one of the other messages.
>
> Best regards
>
> Christian
>
>
> Am 12.01.2011 17:19, schrieb Maatari:
>> To be further specific here is one of the specific intent use.
>>
>> My intermediary is like a platform that verify message and 
>> transmit/forward
>> them to the original receiver.
>>
>> If an end point is registered, it can send and receive message via the
>> platform. The intermediary is like a certification intermediary. As an
>> endpoint, you will only accept message that are somehow certify by this
>> intermediary.
>>
>> Hence, endpoint A, want to send a message to endpoint B, that is 
>> certify by
>> intermediary 0. Hence intermediary 0, receive it and shall know that 
>> it is
>> intended for endpoint B, but only do the job of verification and 
>> forwarding
>> if endpoint B, is registered to it and if the content is appropriate.
>>
>>
>> Many thanks,
>>
>> -M-
>

-- 
----
http://www.liquid-reality.de


Re: Soap Intermdiaries and CXF

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Maatari,

I do not know of any way to specify intermediaries in the wsdl (that 
does not mean there is no way ;-).

If I understood you correctly then you want your intermediary to kick in 
for any service call. So what I would do is add the
intermediary as an interceptor into the cxf bus. That means it is called 
for any service call.

In the interceptors documentation on the wiki there is a paragraph 
"adding interceptors through configuration".
http://cxf.apache.org/docs/interceptors.html

If you use spring to configure cxf then this should help you. In any 
case writing such an interceptor is not easy if you are not familiar 
with the
framework internals.

Dan pointed me to an example inside the Talend Service Factory (Apache 
Licensed).
http://www.talend.com/download.php
You need the Talend-SF-2.3.1 download.

There is an example configuration_interceptor that shows how to plug an 
interceptor into all service calls. The interceptor does gzip 
compression / decompression. So this
interceptor code is probably not so interesting for you. I guess you 
rather would like to write your interceptor in  a way to work on the dom 
document like Dan described in one of the other messages.

Best regards

Christian


Am 12.01.2011 17:19, schrieb Maatari:
> To be further specific here is one of the specific intent use.
>
> My intermediary is like a platform that verify message and transmit/forward
> them to the original receiver.
>
> If an end point is registered, it can send and receive message via the
> platform. The intermediary is like a certification intermediary. As an
> endpoint, you will only accept message that are somehow certify by this
> intermediary.
>
> Hence, endpoint A, want to send a message to endpoint B, that is certify by
> intermediary 0. Hence intermediary 0, receive it and shall know that it is
> intended for endpoint B, but only do the job of verification and forwarding
> if endpoint B, is registered to it and if the content is appropriate.
>
>
> Many thanks,
>
> -M-

-- 
----
http://www.liquid-reality.de


Re: Soap Intermdiaries and CXF

Posted by Maatari <ok...@yahoo.fr>.
To be further specific here is one of the specific intent use. 

My intermediary is like a platform that verify message and transmit/forward
them to the original receiver. 

If an end point is registered, it can send and receive message via the
platform. The intermediary is like a certification intermediary. As an
endpoint, you will only accept message that are somehow certify by this
intermediary. 

Hence, endpoint A, want to send a message to endpoint B, that is certify by
intermediary 0. Hence intermediary 0, receive it and shall know that it is
intended for endpoint B, but only do the job of verification and forwarding
if endpoint B, is registered to it and if the content is appropriate. 


Many thanks,

-M-
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3338422.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Soap Intermdiaries and CXF

Posted by Maatari <ok...@yahoo.fr>.
Thx for the answer.

Please, can you tell me how do you specify in a wsdl file that there  
is an intermediary endpoint. In the last version of WSDL of course. Is  
it the actor field, I don't really understand how to use it.

Once you have an intermediary in the WSDL file, will a dynamic client  
generate with CXF, know where to send the data automatically, or shall  
I manually specify it and if yes please how?

Furthermore, Is the intermediary just another web-service develop at  
the intermediary point specified with the "actor" adress in the WSDL  
that can be found on the final endpoint where is the actual expect web- 
service provider?

What I mean is, i don't know and understand where does fit those  
interceptor in the overall architecture. Can any of you please give me  
the big picture.

Like what has to be developed, deploy, and where? how the message goes  
from the client to the final web-service via the intermediary. shall  
the intermediary be another web-service with interceptors?

Kind regards,
-M-


On Dec 1, 2010, at 7:41 PM, Daniel Kulp [via CXF] wrote:

> On Wednesday 01 December 2010 12:54:39 pm Christian Schneider wrote:
> > In CXF you could adapt the example give in the mail from  
> devakatiyar to
> > achieve the same.
> > Attaching the interceptor to a CXF endpoint is much easier than  
> setting
> > up camel and cxf. The downside is that interceptors in
> > CXF are not so easy to work with as they need to work on streams.
>
> Actually, not true at all.   You could put an interceptor late in  
> the chain
> (like USER_LOGICAL) and then you could deal with the JAXB objects  
> directly to
> verify it's content or whatever.
>
> If you stick it in the PRE_PROTOCOL phase, you could call
>         SOAPMessage doc = msg.getContent(SOAPMessage.class);
>         if (doc == null) {
>             new SAAJInInterceptor().handleMessage(msg);
>             doc = msg.getContent(SOAPMessage.class);
>         }
>
> to get the SOAP message as a SAAJ/DOM and do all the XPath things  
> and such
> just fine as well.
>
> Basically, there is quite a bit of flexibility that you could do  
> depending on
> the requirements.
>
>
> Dan
>
>
> >
> > Best regards
> >
> > Christian
> >
> > Am 01.12.2010 14:10, schrieb Maatari:
> > > Thank you guys for your answers. Actually, I need to manipulate  
> and
> > > see the content of the message. Basically, to cut the story  
> short the
> > > idea is that, the intermediaries will have the responsibility to  
> check
> > > the content of the message and analyze the semantic implication of
> > > each message to monitor conversation. In other term, is the  
> message
> > > authorized, does the message imply obligation from the sender  
> etc.....
> > > Hence I need to see the content of the message and forward or  
> stop it
> > > if necessary while, keeping track of the semantic implication of  
> the
> > > messages.
> > >
> > > On Dec 1, 2010, at 8:09 AM, Christian Schneider [via CXF] wrote:
> > >> That depends on what the intermediary should do. If it should  
> work
> > >> with
> > >> java objects deserialized from the incoming soap request then  
> CXF will
> > >> help you of course.
> > >> If the intermediary should simply route based on the xml or  
> based on
> > >> some header fields then apache camel will be a better solution.
> > >>
> > >> Best regards
> > >>
> > >> Christian
> > >>
> > >> Am 01.12.2010 02:33, schrieb Maatari:
> > >>> Dear All
> > >>>
> > >>> Is there any facilities/helps provided by the framework to
> > >>
> > >> implement a soap
> > >>
> > >>> intermediary ?
> > >>>
> > >>> I would like to implement an intermediary between a client and a
> > >>
> > >> service as
> > >>
> > >>> 3 endpoint situated at different location.
> > >>>
> > >>>
> > >>> Many thanks
> > >>
> > >> View message @
> > >> http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p32
> > >> 87283.html To unsubscribe from Soap Intermdiaries and CXF,  
> click here.
>
> -- 
> Daniel Kulp
> [hidden email]
> http://dankulp.com/blog
>
>
> View message @ http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3288171.html
> To unsubscribe from Soap Intermdiaries and CXF, click here.


-- 
View this message in context: http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3338397.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Soap Intermdiaries and CXF

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 01 December 2010 12:54:39 pm Christian Schneider wrote:
> In CXF you could adapt the example give in the mail from devakatiyar to
> achieve the same.
> Attaching the interceptor to a CXF endpoint is much easier than setting
> up camel and cxf. The downside is that interceptors in
> CXF are not so easy to work with as they need to work on streams.

Actually, not true at all.   You could put an interceptor late in the chain 
(like USER_LOGICAL) and then you could deal with the JAXB objects directly to 
verify it's content or whatever.  

If you stick it in the PRE_PROTOCOL phase, you could call 
        SOAPMessage doc = msg.getContent(SOAPMessage.class);
        if (doc == null) {
            new SAAJInInterceptor().handleMessage(msg);
            doc = msg.getContent(SOAPMessage.class);
        }

to get the SOAP message as a SAAJ/DOM and do all the XPath things and such 
just fine as well.  

Basically, there is quite a bit of flexibility that you could do depending on 
the requirements.


Dan


> 
> Best regards
> 
> Christian
> 
> Am 01.12.2010 14:10, schrieb Maatari:
> > Thank you guys for your answers. Actually, I need to manipulate and
> > see the content of the message. Basically, to cut the story short the
> > idea is that, the intermediaries will have the responsibility to check
> > the content of the message and analyze the semantic implication of
> > each message to monitor conversation. In other term, is the message
> > authorized, does the message imply obligation from the sender etc.....
> > Hence I need to see the content of the message and forward or stop it
> > if necessary while, keeping track of the semantic implication of the
> > messages.
> > 
> > On Dec 1, 2010, at 8:09 AM, Christian Schneider [via CXF] wrote:
> >> That depends on what the intermediary should do. If it should work
> >> with
> >> java objects deserialized from the incoming soap request then CXF will
> >> help you of course.
> >> If the intermediary should simply route based on the xml or based on
> >> some header fields then apache camel will be a better solution.
> >> 
> >> Best regards
> >> 
> >> Christian
> >> 
> >> Am 01.12.2010 02:33, schrieb Maatari:
> >>> Dear All
> >>> 
> >>> Is there any facilities/helps provided by the framework to
> >> 
> >> implement a soap
> >> 
> >>> intermediary ?
> >>> 
> >>> I would like to implement an intermediary between a client and a
> >> 
> >> service as
> >> 
> >>> 3 endpoint situated at different location.
> >>> 
> >>> 
> >>> Many thanks
> >> 
> >> View message @
> >> http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p32
> >> 87283.html To unsubscribe from Soap Intermdiaries and CXF, click here.

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

Re: Soap Intermdiaries and CXF

Posted by Maatari <ok...@yahoo.fr>.
Thx for the tip, but in my case, i don't have a dummy service or a frontend
service to hide other service to which the message is dispatched after. It
is explicit intermediaries. I would like to know how do you explicitly
specify an intermediary and handle in the client with respect to the wsdl
file (is it manual, shall i extract the intermediary from the wsdl file, how
with cxf?), in the intermediary, and etc....



Does anyone has a clue here please?
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3340584.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Soap Intermdiaries and CXF

Posted by Maatari <ok...@yahoo.fr>.
Thx for the answer.

Please, can you tell me how do you specify in a wsdl file that there  
is an intermediary endpoint. In the last version of WSDL of course. Is  
it the actor field, I don't really understand how to use it.

Once you have an intermediary in the WSDL file, will a dynamic client  
generate with CXF, know where to send the data automatically, or shall  
I manually specify it and if yes please how?

Furthermore, Is the intermediary just another web-service develop at  
the intermediary point specified with the "actor" adress in the WSDL  
that can be found on the final endpoint where is the actual expect web- 
service provider?

What I mean is, i don't know and understand where does fit those  
interceptor in the overall architecture. Can any of you please give me  
the big picture.

Like what has to be developed, deploy, and where? how the message goes  
from the client to the final web-service via the intermediary. shall  
the intermediary be another web-service with interceptors?

Kind regards,
-M-
On Dec 1, 2010, at 6:55 PM, Christian Schneider [via CXF] wrote:

> This sounds like you want a generic interceptor that filters and logs
> all messages.
> Basically this is a great job for apache camel but it would mean  
> having
> another framework in your stack.
> In camel you can use an expression like:
>
> from("jetty://server/service")
> .bean(filterbean)
> .to("direct:cxfendpoint")
>
> In the CXF endpoint you use address="camel:direct:cxfendpoint" to  
> attach
> the route to this endpoint.
>
> The filterbean could look like below and simply has to exist in the
> spring config as a bean with id filterbean.
> class FilterBean {
>      public void filter(Document doc) {
>          // work on the document e.g. with xpath
>          // throw an exception to stop the message
>      }
> }
> Alternatively you can do use choice with an xpath expression  
> directly in
> the route.
>
> In CXF you could adapt the example give in the mail from devakatiyar  
> to
> achieve the same.
> Attaching the interceptor to a CXF endpoint is much easier than  
> setting
> up camel and cxf. The downside is that interceptors in
> CXF are not so easy to work with as they need to work on streams.
>
> Best regards
>
> Christian
>
> Am 01.12.2010 14:10, schrieb Maatari:
>
> > Thank you guys for your answers. Actually, I need to manipulate and
> > see the content of the message. Basically, to cut the story short  
> the
> > idea is that, the intermediaries will have the responsibility to  
> check
> > the content of the message and analyze the semantic implication of
> > each message to monitor conversation. In other term, is the message
> > authorized, does the message imply obligation from the sender  
> etc.....
> > Hence I need to see the content of the message and forward or stop  
> it
> > if necessary while, keeping track of the semantic implication of the
> > messages.
> >
> >
> >
> >
> > On Dec 1, 2010, at 8:09 AM, Christian Schneider [via CXF] wrote:
> >
> >> That depends on what the intermediary should do. If it should work
> >> with
> >> java objects deserialized from the incoming soap request then CXF  
> will
> >> help you of course.
> >> If the intermediary should simply route based on the xml or based  
> on
> >> some header fields then apache camel will be a better solution.
> >>
> >> Best regards
> >>
> >> Christian
> >>
> >>
> >> Am 01.12.2010 02:33, schrieb Maatari:
> >>
> >>> Dear All
> >>>
> >>> Is there any facilities/helps provided by the framework to
> >> implement a soap
> >>> intermediary ?
> >>>
> >>> I would like to implement an intermediary between a client and a
> >> service as
> >>> 3 endpoint situated at different location.
> >>>
> >>>
> >>> Many thanks
> >> --
> >> ----
> >> http://www.liquid-reality.de
> >>
> >>
> >>
> >> View message @ http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3287283.html
> >> To unsubscribe from Soap Intermdiaries and CXF, click here.
> >
>
> -- 
> ----
> http://www.liquid-reality.de
>
>
>
> View message @ http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3288079.html
> To unsubscribe from Soap Intermdiaries and CXF, click here.


-- 
View this message in context: http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3338399.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Soap Intermdiaries and CXF

Posted by Christian Schneider <ch...@die-schneider.net>.
This sounds like you want a generic interceptor that filters and logs 
all messages.
Basically this is a great job for apache camel but it would mean having 
another framework in your stack.
In camel you can use an expression like:

from("jetty://server/service")
.bean(filterbean)
.to("direct:cxfendpoint")

In the CXF endpoint you use address="camel:direct:cxfendpoint" to attach 
the route to this endpoint.

The filterbean could look like below and simply has to exist in the 
spring config as a bean with id filterbean.
class FilterBean {
     public void filter(Document doc) {
         // work on the document e.g. with xpath
         // throw an exception to stop the message
     }
}
Alternatively you can do use choice with an xpath expression directly in 
the route.

In CXF you could adapt the example give in the mail from devakatiyar to 
achieve the same.
Attaching the interceptor to a CXF endpoint is much easier than setting 
up camel and cxf. The downside is that interceptors in
CXF are not so easy to work with as they need to work on streams.

Best regards

Christian

Am 01.12.2010 14:10, schrieb Maatari:
> Thank you guys for your answers. Actually, I need to manipulate and
> see the content of the message. Basically, to cut the story short the
> idea is that, the intermediaries will have the responsibility to check
> the content of the message and analyze the semantic implication of
> each message to monitor conversation. In other term, is the message
> authorized, does the message imply obligation from the sender etc.....
> Hence I need to see the content of the message and forward or stop it
> if necessary while, keeping track of the semantic implication of the
> messages.
>
>
>
>
> On Dec 1, 2010, at 8:09 AM, Christian Schneider [via CXF] wrote:
>
>> That depends on what the intermediary should do. If it should work
>> with
>> java objects deserialized from the incoming soap request then CXF will
>> help you of course.
>> If the intermediary should simply route based on the xml or based on
>> some header fields then apache camel will be a better solution.
>>
>> Best regards
>>
>> Christian
>>
>>
>> Am 01.12.2010 02:33, schrieb Maatari:
>>
>>> Dear All
>>>
>>> Is there any facilities/helps provided by the framework to
>> implement a soap
>>> intermediary ?
>>>
>>> I would like to implement an intermediary between a client and a
>> service as
>>> 3 endpoint situated at different location.
>>>
>>>
>>> Many thanks
>> -- 
>> ----
>> http://www.liquid-reality.de
>>
>>
>>
>> View message @ http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3287283.html
>> To unsubscribe from Soap Intermdiaries and CXF, click here.
>

-- 
----
http://www.liquid-reality.de


Re: Soap Intermdiaries and CXF

Posted by Maatari <ok...@yahoo.fr>.
Thank you guys for your answers. Actually, I need to manipulate and  
see the content of the message. Basically, to cut the story short the  
idea is that, the intermediaries will have the responsibility to check  
the content of the message and analyze the semantic implication of  
each message to monitor conversation. In other term, is the message  
authorized, does the message imply obligation from the sender etc.....  
Hence I need to see the content of the message and forward or stop it  
if necessary while, keeping track of the semantic implication of the  
messages.




On Dec 1, 2010, at 8:09 AM, Christian Schneider [via CXF] wrote:

> That depends on what the intermediary should do. If it should work  
> with
> java objects deserialized from the incoming soap request then CXF will
> help you of course.
> If the intermediary should simply route based on the xml or based on
> some header fields then apache camel will be a better solution.
>
> Best regards
>
> Christian
>
>
> Am 01.12.2010 02:33, schrieb Maatari:
>
> > Dear All
> >
> > Is there any facilities/helps provided by the framework to  
> implement a soap
> > intermediary ?
> >
> > I would like to implement an intermediary between a client and a  
> service as
> > 3 endpoint situated at different location.
> >
> >
> > Many thanks
>
> -- 
> ----
> http://www.liquid-reality.de
>
>
>
> View message @ http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3287283.html
> To unsubscribe from Soap Intermdiaries and CXF, click here.


-- 
View this message in context: http://cxf.547215.n5.nabble.com/Soap-Intermdiaries-and-CXF-tp3287079p3287625.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Soap Intermdiaries and CXF

Posted by Christian Schneider <ch...@die-schneider.net>.
That depends on what the intermediary should do. If it should work with 
java objects deserialized from the incoming soap request then CXF will 
help you of course.
If the intermediary should simply route based on the xml or based on 
some header fields then apache camel will be a better solution.

Best regards

Christian


Am 01.12.2010 02:33, schrieb Maatari:
> Dear All
>
> Is there any facilities/helps provided by the framework to implement a soap
> intermediary ?
>
> I would like to implement an intermediary between a client and a service as
> 3 endpoint situated at different location.
>
>
> Many thanks

-- 
----
http://www.liquid-reality.de