| Author |
Using UDDI dynamically
|
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
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:
|
Groovy
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
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
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
Lasse What if it requires 3 parameters and my program has no clue of the 3rd one.
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
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.
|
 |
 |
|
|
subject: Using UDDI dynamically
|
|
|