JavaBeat
Search JavaBeat

JAVABEAT
home
articles
tips
QnA
Books
forums
ARTICLE TOPICS
All Articles
Java 5.0
Java 6.0
EJB 3.0
JCA
Struts
JSF
Spring
Groovy
JBoss Seam
Hibernate
Eclipse
JavaFx
Google Guice
J2ME
GWT
WebServices
AJAX
ARCHIVE
2007 | 12 11 10 09 08 07 06 05 04 03
2008 | 04 03 02 01
CERTIFICATION KITS
350 SCJP 1.5 Mock Exams
400 SCJP 1.6 Mock Exams
300 SCWCD 5.0 Mock Exams
300 SCBCD 5.0 Mock Exams
Enter email address:

Latest JavaBeat Articles Delivered by FeedBurner
OUR NETWORK
javabeat
planetoss
Sponsors
Java Jobs eCommerce software Get Ubuntu 8.04 Get FireFox 3.0  

Pages : 1 2

Accessing Web Services from JSF applications

Author : Raja
Date : Sat Nov 10th, 2007
Topic : jsf webservice 

1) Introduction

In this technical article, let us see how it is possible to access Web Services from JSF Applications. JSF Application resides in the Web Tier of a typical Enterprise Application, whereas Web Services are External Services that reside in the Application Tier. We make use of Java EE 5 for developing the Sample Application in the final section of this article. It is assumed that readers have sufficient knowledge of JSF and Web Services before continuing this article. They also can have a glance over the introductory JavaBeat article on Java Server Faces before proceeding with this.

2) Web Services

2.1) Introduction

Web Services have been there in the software market over a decade of years and they are gaining more popularity in the recent years. Web Services provide an integration layer between two heterogeneous Applications. With Web Services, it is now possible to access a Java Application that is running in some remote machine with the client being any of the compliant languages like C, C++ or C#. This ensures that Web Services promote language interoperability. It is not necessary that both the Server and Client Application must be running in the same platform, thereby making it platform independent. Web Services alone is not a standard, instead it is a combination of several standards like SOAP, WSDL etc.

2.2) SOAP

SOAP stands for Simple Object Access Protocol and this is used in Web Services for transmitting messages between the Client and the Server. Technically, a SOAP message is in Xml format that conforms to a well defined schema. It means that a Client Application will construct its request in a SOAP message and send the message to the Server. The Server after unpacking the SOAP message will analyze the type of request and will return a suitable response in the form of a SOAP message.

Given below is a sample illustrating the structure of a Sample SOAP message,

soap.xml


<Soap:Envelope 
xmlns:Soap="http://schemas.xmlsoap.org/soap/envelope/"> 

    <Soap:Header> 
        ...
    </Soap:Header> 

    <Soap:Header> 
        ... 
    </Soap:Header>  

    <Soap:Body xmlns:MyData="http://mydata.com"> 
    </Soap:Body> 

</Soap:Envelope> 

The SOAP message has an outer core called the SOAP Envelope followed by optional SOAP Headers. Following the SOAP Headers is the SOAP Body which will contain the Application that needs to be processed.

2.3) WSDL

WSDL stands for Web Service Description Language and this is the Client facing interface for accessing the Web Service. A typical WSDL file, which is also in Xml format, will list down all the possible Web Service that can be accessed over the Internet. Not only it will list down all the Web Services, but also the various supported operations that a particular Web Service will support.

 
Pages : 1 2
 

Sponsors
Webmaster Hosting Forum
Java Jobs
MyVideoLib
India News
Internet Advances
Latest QnA
SCJD Tips
When we start a thread by applying start() method on it ,how does it knows that to execute run()method?
About Wrapper class in Java
How to configure weblogic 7.0 in MyEclipse?
Static Block and Static Initializer in Java

JavaBeat Media (2004-2008), India
javabeat | planetoss | links directory | advertise
Copyright (2004 - 2008), JavaBeat