Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to obtain more than one Response from a Web Service

 
Gustavo Santos
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Java Ranches,

My Web Service has 4 methods and I would like to know how to call these 4 methods and get its respective responses in the same XML that the Web Service provides, I'm currently using Axis2.

e.g.:

calling the method:

XML request for the Web Service:



XML response from the Web Service:



Does anybody know how to get more than one Response in the same XML from the Web Service? 'cause I need to send just one request saying the methods that I would like to get the response from.

Any help would be appreciated,

Many Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The model is One request - One method - One response.

Maybe you need a new method that aggregates the other 4.

Bill
 
Chintan Rajyaguru
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William is correct. But I would like to expand on what he said.

Web service works in request/response style so when you invoke a method, it will send you the response of that method. If you must combine the responses you could write a proxy that will invoke 4 methods separately, intercept their responses and combine them.

Having said that, your design seems little bit awkward. Why would you want to combine the 4 responses in one XML? Are you sure you have designed your service correctly?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Well, I guess it could be four original services that need to be combined in a new way by a web service broker (http://www.corej2eepatterns.com/Patterns2ndEd/WebServiceBroker.htm) of some kind?
Best regards!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic