Is this a good use case for interceptors

52 views
Skip to first unread message

Gary W

unread,
Mar 16, 2015, 9:55:29 AM3/16/15
to membrane...@googlegroups.com
Hello Thomas

I'm working on a proxy design and wanted to see if by chance things like this may be out of box, possible future or if interceptors would work

I've attached a diagram of 3 separate requirements
1). SOAP coming in with xpath route to either a soap or a transform to rest.

2). SOAP coming in, to rest transform. I noticed in previous post Rest2Soap and was wondering if Soap2Rest was on the horizon.

3). SOAP coming in, to a replicator which issues requests multiple soap and rest services and then merges the responses.


Do you think 1 and 3 can be done in a interceptors? 
Is by chance anything already done to do this?
Is by chance anything like this planned for a future release?

Thanks
Gary

draft Design.pdf

Thomas Bayer

unread,
Mar 16, 2015, 10:42:09 AM3/16/15
to membrane...@googlegroups.com
Hi Gary,

Am 16.03.15 um 14:55 schrieb Gary W:
>
>
> I'm working on a proxy design and wanted to see if by chance things
> like this may be out of box, possible future or if interceptors would work
>
> I've attached a diagram of 3 separate requirements
> 1). SOAP coming in with xpath route to either a soap or a transform to
> rest.
For XPath routes there is the switch interceptor:
http://www.membrane-soa.org/service-proxy-doc/4.0/configuration/reference/switch.htm

SOAP to REST is the same as in 2.)
>
> 2). SOAP coming in, to rest transform. I noticed in previous post
> Rest2Soap and was wondering if Soap2Rest was on the horizon.
Actually we are working on the REST to SOAP part.
>
> 3). SOAP coming in, to a replicator which issues requests multiple
> soap and rest services and then merges the responses.
For that I would consider using Apache Camel.
>
>
> Do you think 1 and 3 can be done in a interceptors?
1 + 2 yes
> Is by chance anything already done to do this?
SOAP to REST was more in need than the other way round. But it was ask
several times recently.

> Is by chance anything like this planned for a future release?
for 2.) yes

Cheers,
Thomas

Gary W

unread,
Mar 16, 2015, 12:27:34 PM3/16/15
to membrane...@googlegroups.com
Thank you Thomas,

It is looking like the target REST service expects formdata like the com.sun.jersey client code looks something like:

              com.sun.jersey.multipart.FormDataMultiPart formDataMultiPart = new FormDataMultiPart();

              formDataMultiPart.field("firstName", "Raj");

Is this something that can be done with the  Soap2Rest implementation? This example of rest uses form data versus json.
Can we do this FormDataMultiPart in an interceptor?

Thanks
Gary

Gary W

unread,
Mar 16, 2015, 12:44:35 PM3/16/15
to membrane...@googlegroups.com
Hi Again Thomas,

for > 1). SOAP coming in with xpath route to either a soap or a transform to 
> rest. 

Is it possible to do a Soap2Rest based on xpath and a forward proxy with no transforms to other xpaths ? 

On Monday, March 16, 2015 at 9:55:29 AM UTC-4, Gary W wrote:

Thomas Bayer

unread,
Mar 20, 2015, 6:47:41 AM3/20/15
to membrane...@googlegroups.com


Am 16.03.15 um 17:44 schrieb Gary W:
Hi Again Thomas,

for > 1). SOAP coming in with xpath route to either a soap or a transform to 
> rest. 
For XPath routes there is the switch interceptor: 
http://www.membrane-soa.org/service-proxy-doc/4.0/configuration/reference/switch.htm 

Is it possible to do a Soap2Rest based on xpath and a forward proxy with no transforms to other xpaths ?

Depends. A Soap2Rest converter has to a mapping from SOAP Operation to Resource URL and method:

getOrder(7) -> GET http://host/orders/7
deleteOrder(7) -> DELETE  http://host/orders/7
createOrder(7, '...','...') -> PUT http://host/orders/7

so it is a bit more complex.

Cheers,
Thomas

Thomas Bayer

unread,
Mar 20, 2015, 6:52:08 AM3/20/15
to membrane...@googlegroups.com
Hi Gary,

Am 16.03.15 um 17:27 schrieb Gary W:
Thank you Thomas,

It is looking like the target REST service expects formdata like the com.sun.jersey client code looks something like:

              com.sun.jersey.multipart.FormDataMultiPart formDataMultiPart = new FormDataMultiPart();

              formDataMultiPart.field("firstName", "Raj");

Is this something that can be done with the  Soap2Rest implementation? This example of rest uses form data versus json.
Soap2Rest does not support MulitPart right now.


Can we do this FormDataMultiPart in an interceptor?
In an interceptor you can do almost everything ,-) I would also do this there.

Cheers,
Thomas
Reply all
Reply to author
Forward
0 new messages