Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSLT or handler

 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was wondering what is best to use in order to change the incoming request? is it better to use XSLT or use handler to change the request?

Suppose i have Web service A which serves WebService B and WebService B serves C and E. C and E have different vocubulary which is handles by WebServices B in order to process request which understandable by WebService A. So my question is which is better to use XSLT or handlers.

for more clarity, suppose there is a verb which C calls "subtract" and E calls "minusops". which basically substracts two numbers passed in request.


For Example, below is intermediatary.
A>>B>>C
A>>B>>E

I don't know if i were able to make question clear enough. Please let me know i were not clear enough

Thanks
nitin
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Where would you insert the XSLT to change the incoming request?
I feel a handler is the obvious place to insert additional processing of in- and out-going requests because:
- The source code of the web service may not be available.
- Separation of concerns.
Separate the additional processing, which in some deployments may not be needed, and the service providing some business logic.
This makes the service more easily changeable.
In the handler, you can of course use XSLT to process messages!

Another approach is to make the service contracts of all services uniform - please refer to this very interesting presentation:
http://www.infoq.com/presentations/Expressing-Service-Capabilities-Uniformly
Best wishes!
 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for xslt processing i can write a filter and apply that in web.xml to handle request. I will go through link.

thanks alot for reply.
 
Vinay Nath
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Ivan, the best way is to use handlers and in there you can perform transformations on the message.

The handlers fit the web service architecture better then filters. What if you have to implement web service as a session bean in future, then you will have to implement the filter's logic in an interceptor.
But if you use handler, it pretty much will remain same.
 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok. thank you guys
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic