Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to publish and discover a java web service  RSS feed

 
Rajeev Pratap
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends I am new to JavaRanch and this is my first post.

I have just started learning Web Services using java. I have an academic project where I need to do dynamic service composition. For that I can't directly create a service-client for a particular service because if I do so then that client will call that particular service only. Client need to search various web services and then out of those services select any one at run time and also call that service at run time.

I was able to develop the web service(JAX-WS) using Eclipse(indigo), I also created the client for that web service and every thing is working fine. Now my problem is that while creating the client I am hard coding the client to call that particular web service only(since I am creating the client using the WSDL file of the service). However I actually need to call any one of the searched service, but for that I need to publish the service some where then discover it and then call it.

I tried publishing the service to juddiv3. But on juddiv3 I could only publish the sample service supplied with the juddiv3. When I try to publish service created by me then it is not getting displayed in the group of published services.

Is there any other UDDI server which I could install on my local machine and then publish and discover the service from that. Also I was not able to figure out how to create a client that will modify itself at run time to call any one service out of various searched services.

Kindly provide the necessary steps and code.

Thanks
 
Tim Moores
Saloon Keeper
Posts: 3829
79
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I try to publish service created by me then it is not getting displayed in the group of published services.

Then you need to debug why that is the case.

Also I was not able to figure out how to create a client that will modify itself at run time to call any one service out of various searched services.

That is tricky. Your best bet would be to use the SAAJ API to create a web service according to the WSDL of each WS; that will be a lot of work. Since you're a beginner with WS, I predict that you won't be able to do this for a general solution (i.e., one that works for any WS you happen to find).

Kindly provide the necessary steps and code.

It's your project = you're doing the work.
 
Ramita Sardana
Greenhorn
Posts: 2
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

How are you trying to publish in juddiv3?
I have used juddi publication API and successfully published my services...steps include:

1. Creating a new publisher
2. Get authentication token
3. Publish a new organization
4. Add details of service to be published (including Tmodel details)
5. Save the service details
6. Query the registry for all published services by passing "%" as a matching param

Please explore DynamicClientFactory provided by Apache CXF framework for creating dynamic client... I am also working on the same thing... need similar help...

Hope this helps!

Regards,
Ramita
 
Rajeev Pratap
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ramita,

Thanks for your post.
I was trying to publish it by simple trying to upload it using 'Pluto' web page provided along with juddiv3. I referred the userguide provided with the juddiv3 bundle, in that some steps were mentioned as how to publish a sample web service(which was provided in .war form along with the bundle) under 'sales node'. I followed the same procedure to publish my own service, but it was not getting displayed under 'sales' section.

I am new to juddiv3 so I don't know much of the process. As you mentioned in your post various steps like : 1. Creating a new publisher 2. Get authentication token ....etc.
Do I need to perform these steps using java code or on the 'Pluto' portal provided with juddiv3. Till now I was trying to publish my service only using 'Pluto' portal.

The main problem which I was facing was that the service was getting deployed to tomcat provided with juddiv3 bundle, however the service was not getting displayed under 'sales node' section of 'Pluto' portal.

Kindly provide few steps as how I should proceed.

I would be thankful for any help.


Regards
Rajeev
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!