my dog learned polymorphism*
The moose likes Web Services and the fly likes using webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "using webservice" Watch "using webservice" New topic
Author

using webservice

sirisha kukunuri
Greenhorn

Joined: Jun 04, 2008
Posts: 13
Hi Every One,
Now i am learning web services.I heard that in real time projects mostly we don't develop web services. Mostly they are developed my some other application developers and we use them in our applications.Like if one company provides xml data and we have to access that data in our application then we are using web services developed that company.
But my doubt is..how can we send a request to get that xml data and how we get that response from web service. I mean how to write code for that.Are there any sites which provide situations like my example to write code.I am really confused with web services.But i tried to explain my doubt as possible as i can.Can any one please clarify my doubt.
Thanks q very much,
Kukunuri.
Praveen Allam
Greenhorn

Joined: Jun 09, 2008
Posts: 5
It depends who you are. If you are the service provider then you need to develop web services and publish the WSDL. But if you are the client you need to generate client stubs using the service provider WSDL and access the service. You can go through few basics from this link: http://ws.apache.org/axis/java/user-guide.html
sirisha kukunuri
Greenhorn

Joined: Jun 04, 2008
Posts: 13
Thanks Praveen,
My doubt is how to develop web service client.What actually WSDL is? I have read tutorials about Web services.But i didn't get clear idea.
Can you please give me any simple example with both service provider side code and client side code.That would be very helpful to me.
Thanks,
Kukunuri.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
There are many different ways to implement a "Web service". Moreover, there are differen types of services that can be implemented, with a variety of styles and outcomes.

In regards to developing a client, this is dependent upon what type of web service will be called and how it is accessed.

WSDL is an acronym for 'web service definition language'. It is an XML-based computer language that is used to describe the details of a web service.

Below is code for an EJB-based Web Service class:


[ June 18, 2008: Message edited by: James Clark ]
NarendraBabu Bandaru
Greenhorn

Joined: May 17, 2008
Posts: 20
WSDL - Web Service Description Language. The services which you are going to publish as a server , will be mentioned here. The Services details, method names, protocal names and the URL how you need to access.

All these details will be mentioned in the WSDL. This is like a contract between server and client.

Server will be providing the services mentioned in this wsdl and the client will request for those services.

There are several ways to implement webservices. With the help of AXIS, JAXWS, CXF, Xfire. Like that there are several ways to implement the web services.
sirisha kukunuri
Greenhorn

Joined: Jun 04, 2008
Posts: 13
Thank q very much for your replies..
sirisha kukunuri
Greenhorn

Joined: Jun 04, 2008
Posts: 13
Hi All,
Can any one please give me both server side and client side code example which gives XML as response.I couldn't find this kind of examples.I saw some examples which are just for adding two numbers or subtraction of two numbers etc..
Thanks.
Sirisha.
NarendraBabu Bandaru
Greenhorn

Joined: May 17, 2008
Posts: 20
I suggest to go through the concepts of JAXB, which will really help in sending request in XML format and getting response back in XML. For this you need to have the XSD available.
If XSD is not avialable , JAXP concepts will help you
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Here is an example that gives an XML response.
Srinivas Vallabhaneni
Greenhorn

Joined: Jun 27, 2008
Posts: 2
Refer the url :-http://ws.apache.org/axis2/1_3/quickstartguide.html
 
 
subject: using webservice