Forums Register Login

Help required! I am new to this area (Java to Web Services)

+Pie Number of slices to send: Send
Let me explain the scenario first, (May be I don�t use the exact terminology, but I hope I can make out what I need)

I have some applications which is running as standalone Swing component
Now for some validation purpose, I have to interact with Web services.
I am nothing to do with web service end, as the service(or wsdl) is already exists in the server, I just need to invoke with some values and should get the response from it.

I hope I explained what I need.

1. How is it possible to talk from standalone java swings component to Web services
2. Is there is any special API will help to do, if yes what is that.
3. Can someone help me to provide some piece of code how to interact?
4. What are the things I should know before I start.

Really appreciate your kind advice, I am desperately waiting for the feedback as its very urgent from my end.

Thanks in advance.
Prasanna T :roll:
+Pie Number of slices to send: Send
You should start by getting a SOAP toolkit like Axis. Those generally come with a tool that creates java classes that can access a WS defined by a WSDL; Axis' tool for doing this is called wsdl2java. There are several ways to use it to generate client code, one is by using XMLBeans. That web page also explains the other ways, although for your purposes it probably doesn't matter which one you use. (You'll need to save the WSDL as a file so that wsdl2java can use it.) The client code that gets generated will have the URL of the WS hardcoded; obviously, you'll have to adapt that to your circumstances.
+Pie Number of slices to send: Send
Thank you, Ulf Dittmer

Now I manage to generate the Stubs, service, ServiceLocator and portType files from the wsdl. But not sure how to implement these with my exiting code.
My code has the required data to be passed, but i didn't get much idea on how to do this

Need advise, on how to use these files...!

Thanks in advance.
+Pie Number of slices to send: Send
The Quick Start Guide I linked to has an example client that shows how to make use of the generated classes. It will be a bot different in your case, because you will have different method names and parameters, but by and large, you should be able to adapt that client without too many problems.
Why fit in when you were born to stand out? - Seuss. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 958 times.
Similar Threads
web service not available
RPC mapping file
New Article: Using Complex Types in Web Services
New Web Application using HTML5
Welcome to Paul Monday
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:19:13.