Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using UDDI dynamically

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose I want to invokes a Web Service that returns stock values for a stock and I do a UDDI search programmatically , the search may throw 2 records. Now, suppose the first WS accepts one parameter (stock symbol)and the 2nd one accepts 2 parameters(stock symbol & stock exchange symbol), how will my program(which invokes the web services ) be able to handle both cases because it may be work when the web services accept stock symbols only?
wsin.getQuote(stockSymbol);
and it does not contain
wsin.getQuote(stocksymbol,stockexchnage)

Or is that it is not possible to use UDDI dynamically and then my code construct argument list for Web Services? Am I missing something here?

I hope you guys have understood my problem and confused you.

:roll:
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obviously you'll have to code the "if else" logic somewhere if you need to support two different interfaces.
Here's how you could do it:
1) Lookup the "access URI" from UDDI using the JAXR API
2) Obtain a javax.xml.rpc.Service using that "access URI" (which should point to a WSDL document)
3) Figure out whether the given Service supports a one-argument or two-argument operation, and invoke whichever you find
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lasse
What if it requires 3 parameters and my program has no clue of the 3rd one.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
What if it requires 3 parameters and my program has no clue of the 3rd one.
Do you have a crystal ball?
If you have no way of figuring out the 3rd parameter, and you cannot sensibly use a "default" value for it, you simply can't use that particular service.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic