aspose file tools*
The moose likes Web Services and the fly likes How to implement a webservice in my application? 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 "How to implement a webservice in my application?" Watch "How to implement a webservice in my application?" New topic
Author

How to implement a webservice in my application?

Ramna Reddy
Ranch Hand

Joined: Aug 06, 2006
Posts: 96
Hi Ranchers,

I am completely new to webservices, but I have a task to implement webservices in my current application;
So, what are the prerequisites I need to have.

My requirement is : I have to implement a service on server(lets say service provider) and I have to access it as a client from my application from a different server.

Please give me a good example,if possible.

Thank you in advance.

ramz
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Do you want to implement a SOAP or a REST web service?
Since you do not give any details on what the web service is to do, it is difficult to give you any advice.
NetBeans.org has a section with web service tutorials covering both SOAP and REST web services and server side as well as client programming.
http://netbeans.org/kb/trails/web.html
Best wishes!
Kj Reddy
Ranch Hand

Joined: Sep 20, 2003
Posts: 1704
Try the following link: http://wso2.org/library/1719
It gives some basic understanding and where to start for beginners.

Provide more details about your requirement then it will possible to give more details.
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
AXIS2 provides good and easy to implement web service stack. You can have a look at AXIS2 user guide to start with.


SCJP 1.5(97%) My Blog
Ramna Reddy
Ranch Hand

Joined: Aug 06, 2006
Posts: 96


Hi Fiends, sorry for not giving much details in my last post.

Here is the actual requirement: Lets say,for example the task is to issue a Ticket for a traveler for a selected flight. So I implement a function/method in my application like issueTicket()... (it takes some required params,that will be defined and will return a updated response)...I want this isseTicket() method accessible for different clients(ofcourse with some authentication)...so how can I use a webservice in this case...

If needed more details,please let me know....

I don't know what is the difference between a SOAP and REST services.

Thanks in advance...

shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
SOAP would be better to use since you may later choose to send attachment in response which is not possible in case of rest. You can have a look of URL mentioned below to start
http://ws.apache.org/axis2/1_0/userguide.html
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
I don't know what is the difference between a SOAP and REST services.

The WebServicesFaq points to introductory material on both WS styles.

SOAP would be better to use since you may later choose to send attachment in response which is not possible in case of rest.

I disagree. There's nothing in the problem statement that indicates that attachments may be needed, and furthermore, there are RESTful alternatives that can serve as full substitutes for attachments; so this seems an unnecessary architectural choice.


Ping & DNS - updated with new look and Ping home screen widget
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
If you need to return a resource representation and an attachment from a RESTful web service, then you can do the following when preparing the representation to be returned:
- Create a resource which is the attachment.
- Enclose the URI of the attachment resource in the resource representation to be returned.
The client can then choose whether or not to retrieve the attachment, using the URI in the resource representation.
The drawback is that two requests are needed if the client chooses to retrieve the attachment resource.
Best wishes!
 
Consider Paul's rocket mass heater.
 
subject: How to implement a webservice in my application?
 
Similar Threads
designing security for soa applications
How to download songs from server?
JVM DNS Caching
Using UnManaged Web Services Client with WS-Policy
Application level security in jax-ws web service