aspose file tools*
The moose likes Web Services and the fly likes Consuming a WebService from an API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Consuming a WebService from an API" Watch "Consuming a WebService from an API" New topic
Author

Consuming a WebService from an API

Jia Malhotra
Greenhorn

Joined: Dec 20, 2011
Posts: 1
Hello,

I am new to working with Web Services.

I am working on an assignment where I am required to communicate with a WebService from a SAAS product which is available online.
The software provides a bunch of API to communicate with external systems and scripting can be done in JavaScript.

One such API provides the capability to request an HTTP(s) URL. The API takes in "url" and "postdata (string/hashtable values)" as parameters along with few other optional parameters.
I think I can use this API to make a call to the WebService. However I am not sure how I can deploy the WebService and make it accessible to this API.

Currently, I am trying to create a very simple WebService, a Calculator.java WebService which takes in two integer parameters and adds them.
I followed the tutorials to deploy a WebService on Apache Axis and created a class file and wsdd file. I deployed the file using the org.apache.axis.client.AdminClient command. After executing the command I can see the service under the following URL. http://localhost:8080/axis/servlet/AxisServlet and a WSDL file generated by it.

However, I am not sure how to proceed from here.
How do I test the WebService?
Also which URL should I be providing to the software API? would it be the WSDL URL or the location URL of the webservice which can be found under the WSDL file?

Any suggestions are greatly appreciated.

Thanks!


Arun Kumar
Ranch Hand

Joined: Oct 10, 2007
Posts: 30
You could use a soap UI tool to test your web services or with the following code snippet


 
Consider Paul's rocket mass heater.
 
subject: Consuming a WebService from an API