This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Writing web service client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Writing web service client" Watch "Writing web service client" New topic
Author

Writing web service client

suchi patil
Greenhorn

Joined: Feb 12, 2006
Posts: 3
Hello All,
I need to write a client which will be invoking a public function from Sky Web server. I have wsdl addr, end-point addr, Function name [which is to be invoked with all parameters] and I m using JDK 1.5 I m totally new into this topic, So can somebody guide me how should I proceed? What else I need to write the client code?
Thnks in advance.
Harathi Rao
Ranch Hand

Joined: Oct 31, 2004
Posts: 42
Hi patil ,

Whats the SOAP engine u r using? I've worked on Apache AXIS and found it pretty cool,

Since u said u know the WSDL address all u need to do at client side is generate Client-side bindings which could be done as follows provided u installed Axis and set the path to the same.

Syntax:
Axis WSDL-to-Java tool in "org.apache.axis.wsdl.WSDL2Java".
java org.apache.axis.wsdl.WSDL2Java (WSDL-file-URL)

with this u generate following Java class(es)
1. For each entry in the type section - A java class
- A holder if this type is used as an inout/out parameter
For each portType A java interface
For each binding A stub class
For each service A service interface
A service implementation (the locator)
Harathi Rao
Ranch Hand

Joined: Oct 31, 2004
Posts: 42
Hi Patil ,

What's the SOAP engine u r using? I've worked on Apache AXIS and found it cool way to start,

Since u said u know the WSDL address all u need to do at client side is generate Client-side bindings which could be done as follows provided u installed Axis and set the path to the same.

you will need to run the Axis WSDL-to-Java tool in "org.apache.axis.wsdl.WSDL2Java".

Syntax:
java org.apache.axis.wsdl.WSDL2Java (WSDL-file-URL)

with this u generate following Java class(es):

1. For each entry in the type section - A java class
- A holder if this type is used as an inout/out parameter
2. For each portType - A java interface
3. For each binding - A stub class
4. For each service - A service interface
- A service implementation (the locator)

I hope this answers you question.
you can also refer this link
http://ws.apache.org/axis/java/user-guide.html#UsingWSDLWithAxis


Thanks
Harathi
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
You don't have to use Axis WSDL2Java - however its a lot easier than crafting those SOAP requests by hand, not to mention prying the answer out of the SOAP response (however it can be done).

While you are currently only interested in writing the client at this time it may still be beneficial to understand both sides.
Creating Web Services with Apache Axis is a quick primer.

3. WSDL2Java: Generate the Server-side Wrapper Code and Stubs For Easy Client Access

6. Client: Write a Client That Uses the Generated Stubs to Easily Access the Web Service

in particular deal with the client-side.

Other than that have a look over the articles in the Web Services FAQ, you may find something that suits your needs.
[ March 01, 2006: Message edited by: Peer Reynders ]
 
 
subject: Writing web service client
 
Similar Threads
Sending Javascript from server to execute on client side.
xml JAVA
HEY RANCHES WHATZ UP!!!
InetAddress, Socket
Calling web services from Spring application