You are on page 1of 33

Webservices &

WL
By
Janaranjani K
Agenda

• Webservices.
• Weblogic configuration.
• Deployment of an EJB component in
WLS.
Webservices
Abstract
Web Services is a technology applicable for
computationally distributed problems, including
access to large databases
– What other technologies were/are available
and how they compare with Web Services?
Why to use more than one
computer?
• Distributed resources
– access to shared data
– access to shared programs
– access to CPU (e.g. many desktop PCs
together), to memory, to special devices (e.g.
printer)
Distributed architecture

• gives
– access to distributed resources
– development encapsulation
• maintainability, re-usability, legacy-
awareness
– implementation independence
• requires
– adding a communication layer between parts
– synchronization of efforts
Continued…

Sending Waiting for


requests, Communication protocol, Data format requests
getting (known location,
known port)
results

• Basic questions are:


– What kind of protocol to use, and what data to
transmit
– What to do with requests on the server side
Traditional CGI-based approach

Sending Waiting for


requests, Data as name/value pairs requests
(known location,
getting known port)
results

• cgi scripts:
– Data transmitted as name-value pairs (HTML
forms)
– Transport over (state-less) HTTP protocol
– no standards for keeping user sessions (state-
fullness)
– server side: a script is called
CORBA-based approach

Sending Waiting for


requests, Data in binary format requests
(known location,
getting known port)
results

• CORBA:
– Data transmitted as objects (at least it looks
like that)
– Transport (usually) over well standardised IIOP
protocol
– user sessions (state-fullness) very inter-
operable
– server side: an RPC call is made
SOAP-based communication

Sending Waiting for


requests, Data in XML format
requests
getting (known location,
known port)
results

• SOAP:
– Data in a well-defined XML format
– Transport over various protocols
• HTTP, SMTP are the most used, perhaps
because they are firewall-friendly
– server side: either an RPC call or a message
delivered
Web services

• A collection of XML-based technologies developed


by the e-business community to address issues
of:
– service discovery
– interoperable data exchange and/or application
invocation
– service compositions (workflow, business
processes)
W3C (working group) definition

A Web service is a software application identified by


a URI, whose interfaces and bindings are capable
of being defined, described and discovered as
XML artefacts. A Web service supports direct
interactions with other software agents using XML
based messages exchanged via internet-based
protocols."
Why Use Web Services?
Major benefits of Web Services include:
• Interoperability among distributed applications
that span diverse hardware and software
platforms
• Easy, widespread access to applications through
firewalls using Web protocols
• A cross-platform, cross-language data model
(XML) that facilitates developing heterogeneous
distributed applications
Web Service Standards
• An implementation hosted by a server on the Web
– WLWS use J2EE components

• A standard for transmitting data and Web Service


invocation calls between the Web Service and the user of
the Web Service
– WLWS use SOAP as message format and HTTP and JMS as
connection protocol.

• A standard for describing the Web Service to clients so they


can invoke it
– WLWS use WSDL
Continued…
• A standard for client applications to invoke a Web Service
– WLWS make use of xml based RPC as part of client
applications

• A standard for digitally signing and encrypting the SOAP


request and response messages between a client
application and the Web Service it is invoking.
– WLWS implements WSS specification

• A standard for client applications to find a registered Web


Service and to register a Web Service.
– WLWS implement UDDI
SOAP

• SOAP (Simple Object Access Protocol) is a


lightweight XML-based protocol used to exchange
information in a decentralized, distributed
environment.
• WebLogic Server includes its own implementation
of SOAP 1.1, SOAP 1.2, and SOAP With
Attachments (SAAJ) specifications.
Continued…
• The protocol consists of:
– An envelope that describes the SOAP message.
The envelope contains the body of the
message, identifies who should process it, and
describes how to process it.
– A set of encoding rules for expressing
instances of application-specific data types.
– A convention for representing remote
procedure calls and responses.
XML Messaging Using SOAP

Service Service
requestor provider
(Application) (Application
webservices)

SOAP SOAP

Network protocol Network protocol

Response

Request Invocation
WSDL
• Web Services Description Language (WSDL) is an
XML-based specification that describes a Web
Service. A WSDL document describes Web
Service operations, input and output parameters,
and how a client application connects to the Web
Service.

• Developers of WebLogic Web Services do not


need to create the WSDL files; you generate
these files automatically as part of the WebLogic
Web Services development process.
UDDI

The Universal Description, Discovery and


Integration (UDDI) specification defines a
standard for describing a Web Service;
registering a Web Service in a well-known
registry; and discovering other registered Web
Services.
Web Services Architecture
Service
registry

UDDI/WSDL
UDDI/WSDL publish
find

Service Service
requestor provider
bind
Web Services Stack
WSFL

Static -> UDDI

Dynamic -> UDDI

WSDL

SOAP

HTTP,FTP,email
etc
Creating WebLogic Web Services:
Main Steps
2. Start the server under the user specific domain.

4. Set the Enviromental variables for that domain to have a


suitable environment to run your application.

6. Run the ant script (if any, or some other equivalent to that)
to compile the application. The ant script should handle the
following:
– Creates the appropriate directory(i.e., build) to place the
Class files.
– Creates META-INF directory(i.e., build\META-INF), under
which ejb-jar.xml is placed.
– Creates jar file of the application(i.e., jar of build directory)
and placed under the
WL_HOME\domains\mydomain\applications.
Continued…

3. To cross verify the same,


– to verify the functionality of the method in your Bean class:
Go to the Weblogic GUI -> deployments -> applications ->
select your apps jar file -> go to Testing tab at the top ->
click
http://localhost:7001/$jar_file_name/$Class_Name
– to check the WSDL : Go to the Weblogic GUI -> deployments
-> applications -> select your apps jar file -> go to Testing
tab at the top -> click
http://localhost:7001/$jar_file_name/$Class_Name?W
SDL
Weblogic
Configuration
WebLogic Configuration
Steps to Develop EJB
component
1. Write the necessary .java files that compose the ejb
component: the component interfaces, home interfaces,
bean class and other needed hepler classes.
2. Write DD and place the same under META-INF (it’s the
traditional way).
3. Compile .java files from step 1 into .class files.
4. Using jar utility, create a jar file containing the .class files
and the DD.
5. Add the vendor specific if any to the configuration file.
6. Write sample client program to test your functionality.

You might also like