wood burning stoves 2.0*
The moose likes Web Services and the fly likes Using UDDI dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Using UDDI dynamically" Watch "Using UDDI dynamically" New topic
Author

Using UDDI dynamically

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8903

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
    
    5
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: 8903

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
    
    5
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using UDDI dynamically
 
Similar Threads
why uddi & webservices?
Newbie question
What Is Web Services?
to understand the web servcie architecture with example
Integrating web services to legacy system