Satellite Internet QuickBooks Advice international calling cards calling cards
JavaBeat Certifications Certifications Kits Articles Tips QNA Interview Questions SCJP 1.5 SCBCD 5.0 Java/J2EE Feeds
Java Interview Questions Submit Your Blog Feedback Request Article Print Email

Accessing Web Services from JSF applications

Author : Raja
Date : Sat Nov 10th, 2007
Topic : jsf webservice 
Pages :
Enter email address:

Latest JavaBeat Articles Delivered

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.

Submit Your Blog Feedback Request Article Print Email

Favorites
C# problem error
Free Newsgroups
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 Website (2004-2009), India
javabeat | about us | useful resources
Copyright (2004 - 2009), JavaBeat