Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to load wsdl file in Java  RSS feed

 
Jitesh Sinha
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement wherein I have to invoke a web service depending upon a condition.Something like this

if(condition)
invoke web service 1
else
invoke web service 2

I think I can somehow find a way to load wsdl through code ,then I can load wsdl file in if and else part and then invoke operations.

if I cannot do this,is there any way to invoke web service by URL?

I know that I can generate jar files by using wsdl files but problem is that both web services have same server classes and methods.They are kept on different hosts due to infrastructure issues.I have to call the two web services to bypass infrastructure issues of one of the hosts.

Any help will be appreciated.Thanks!
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
What you can do is generate artifacts for one of the server and then, programatically, set the endpoint address.
The following URL points to a webpage showing how to do that when using JAX-WS:
http://jax-ws.java.net/guide/How_to_invoke_and_endpoint_by_overriding_endpoint_address_in_the_WSDL.html
Best wishes!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!