This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Web Services and the fly likes exposes a web service and create a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "exposes a web service and create a file" Watch "exposes a web service and create a file" New topic
Author

exposes a web service and create a file

Helen Ross
Greenhorn

Joined: Feb 23, 2012
Posts: 13
Hi

I am currently trying to expose a web service to an external application which should allow me to read in information such as first name, surname and a few other details. I want to store this information in a csv file and then call another web service on this. Is this possible? And where would be the best place to look to get a basic example of this?

Sorry if this is a very basic question but I am very new to web services and the code which I currently trying to support is not very well maintained.

Thank you for your time.
Carlo Moore
Greenhorn

Joined: Aug 02, 2005
Posts: 27
It should be possible. I don't think you can send the csv file via SOAP though, but you can probably use a servlet if you wanted to do that.

Will you be deploying your webservice as part of an application?

There are some tutorials available on mkyong jax-ws-wsgen-tool-example.
I'm sure there are loads of examples out there. You can look at metro jax-ws. Part of the download bundle I think there are examples.

Edit if you're using JBoss have a look at JBossWS
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Keep in mind that web services are for connecting applications. So, you want to design an application that enables a human user to enter information. The application then creates a CSV file and calls a web service to send the gathered information (in the form of a CSV file.) This is possible.

In order to attach files to SOAP messages, there is an API for this, SwA (SOAP with Attachments.)

In this scenario there is only one web service, not two.
Helen Ross
Greenhorn

Joined: Feb 23, 2012
Posts: 13
Thank you Jimmy for the reply. I want a web service that will take a allow another application to pass values into my application. I then want my application to create the .csv file to be stored in a certain location as I need to be able to pick it up for editing within my application.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Ok. Based on your new statement, you do not need to use the SOAP with Attachments API since your do not want to create a web service that includes a file.

You want to create a data-oriented web service that will enable client applications to send data to your application. This is relatively basic and a good approach. In order to create this web service, you will also need to develop an internal client application to simulate the service's users and to test the web service during development.

The first task then is to clearly identify the data that will be transmitted. This includes data type, how many values, and size. Here you should also be thinking about security requirements such as how will you identify authorized applications. The details of what your application does once it receives the data are irrelevant in terms of developing the web service component.

The purpose of this web service is to simply allow client applications to send data to your application. The web service does not create CSV files or do any processing of the information sent. "Web Services" is a Integration technology not an Implementation technology.

You can surely find a variety of examples of web services. There are many different flavors of implementations as well as multiple styles, e.g. RESTful, SOAP.

I suggest that you visit the Apache Axis site and go through their documentation. Once you have a good understanding of what is required to develop a web service using the Axis SOAP Engine, roll yor sleeves up and give it a try. Good luck!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exposes a web service and create a file
 
Similar Threads
Authentification
Developing basic web service in eclipse
Web Service Creation With AttachMent
Need a help on Web service startup
Existing java class as a web service using axis2