• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to obtain more than one Response from a Web Service

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
The first person to drink cow's milk. That started off as a dare from this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic