Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Confusion with Request and Response message design for wsdl file: SOAP Web Service  RSS feed

 
Roshan Prabhu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am designing a web service which supports two kinds of requests.
So I am wondering how would I design the request messages.

Consider the case as a web service that provides online messaging service.

Here the requests would be :
1. ListOfOnlineUsers_Request
2. MessageUpload_Request

These would be handled by a single 'endpoint' (By the way, I am using spring web service framework).
So here I will end up having two request messages in the WSDL. Now I am worrying if I should have had a single request tag type
wrapping around each request and they will be un-wrapped at end point.

Hope this is clear enough.

Prabhu
 
shivendra tripathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be better design if you have to operations corresponding to messages for single endpoint.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
What would you gain from having one single request type tag for the two different requests?

One thing that often is overlooked when designing a web service is the ability to "wrap" multiple requests in one request.
Example:
If I have a web service operation that retrieves the authors of a book given its ISBN, I would have to make 10 requests if I want information for 10 books.
Instead, the web service operation could be designed to accept a variable number of ISBN numbers and generate a list of responses.
This way I can request the authors of one single book or the authors of 10 books with one single request and one single response.
Best wishes!
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prabhu,
Now I am worrying if I should have had a single request tag type
wrapping around each request and they will be un-wrapped at end point.

There is no hard and fast rule to apply a particular type of design. The way you design really depends on how your web service is going to cater client request. Let me give you few scenarios.
1. When two requests are preferred over one request?
If the two requests can be called "singly" to service end client request.

2. When one request is preferred over two requests?
When you know that calling a single request doesn't serve your purpose completely and you "must" also call the second one in the same end client request.

Hope this helps!

 
Roshan Prabhu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Thanks for all of your responses

It would be better design if you have to operations corresponding to messages for single endpoint.

Sorry Shivendra, I couldn't understand it properly I guess, did you mean
if you have two operations


And Ivan, I feel your suggestion is good one. In my case the request are as following:



I use a single endpoint to handle both the requests. And the second request depends on the response for the first.
So I am planning to have two separate request messages, in this case.

The point of confusion for me was that if, an endpoint should see only a request and send a response (I wanted to know if there are any specifoc design conventions). In such a case my requests should have looked like




So how should I go head in this scenario ?

Thanks to all,
Prabhu

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I don't know of any special design convention that could apply in this case, but there is nothing stopping you from combining the two requests into one, where each "subrequest" is optional and will be handled only if data is present:

In fact, the <ListOfOnlineUsers_Request> and the <MessageUpload_Request> elements could be optional instead of their contents being optional. I think this will simplify things.
Best wishes!
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In fact, the <ListOfOnlineUsers_Request> and the <MessageUpload_Request> elements could be optional instead of their contents being optional.

Ivan's example is spot on! This is the way how most of the "SOA" applications are designed, mostly coarse grained.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!