Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing web service client

 
suchi patil
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic