Title: New BEA Technologies To Deliver Web Based Applications
1New BEA TechnologiesTo Deliver Web Based
Applications
- WLS 7.0, Web Services and Cajun
2Agenda
- What is WebLogic Workshop? (Cajun)
- Workshop architecture
- Design-time IDE
- Run-time Framework
- Java Web Service (JWS) Files
- Asynchronous web services framework
- Controls (CTRL Files)
- XML Mapping Script
3Introductions
- Who am I?
- Quick survey about you
- By show of hands, how long have you been
programming in Java? - Ask questions!
4Agenda
- What is WebLogic Workshop? (Cajun)
- Workshop architecture
- Design-time IDE
- Run-time Framework
- Java Web Service (JWS) Files
- Asynchronous web services framework
- Controls (CTRL Files)
- XML Mapping Script
5What is BEA WebLogic Workshop?
- BEA WebLogic Workshop is a new integrated
development framework for the BEA WebLogic
Platform - WebLogic Workshop makes it incredibly simple for
application developers to build enterprise class
web services - WebLogic Workshop enables teams of developers
with different skill sets to utilize the proven
reliability, and scalability of BEA WebLogic
Server - WebLogic Workshop was formerly referred to by the
code name Cajun
6Workshop Makes it Simple
- Building applications on the J2EE platform is
hard - Highly object oriented
- Need to understand the J2EE component model just
to build simple applications - Many rich and complex APIs overkill for most
common cases - All the low level details are exposed
- Deploying applications is tedious and time
consuming - Workshop puts the focus on application logic
- Visual metaphor for building web services
- Declarative, annotated code exposes web service
functionality - Server-side controls encapsulate J2EE APIs
- Plumbing code managed by runtime framework
7Enterprise Class Web Services
- What is a Web Service?
- A software component or application exposed
through standard XML and Internet protocols - Three key standards
- Simple Object Access Protocol (SOAP)
- Web Services Definition Language (WSDL)
- Universal Description, Discovery, and Integration
(UDDI) - The stock quote example
8Misunderstanding Web Services
- The common understanding of web services is
limited - Function calls over the internet
- Simple, synchronous, request-response model
- This is interesting, but only the tip of the
iceberg
9Principles of Web Services
- Three key principles for that make Web Services
so promising are a further move towards - Loose coupling
- Coarse grained calls
- Asynchronous systems
- Providing potential to solve previously
unaddressed (or unresolved) integration problems
in the enterprise
10Adopting Web Services
- For Web Services to reach its true potential
certain requirements must be met - Standards based
- Business level integration
- Flexible architecture designed for extensibility
and change - Accommodate internal and external integration
11Enterprise Class Web Services
- Web Services allows for this architecture
- But you need the right programming model to make
it easy to build applications this way - Many moving parts at the standards layer (SOAP,
WSDL, UDDI) - Not easy to think asynchronously
- Plus, you need a reliable, available, scalable
platform that lets you deploy these web services
in the enterprise - Transactions
- Connection pooling
- Caching
- Security
12BEA WebLogic Workshop Value
- A standard Java environment that allows
developers of all skill sets to take advantage of
J2EE - An event based approach and programming model
that makes it easy to fully leverage the power of
Web Services - A way to maximize the development organization
- One standard platform (everyone can play on J2EE)
- Enables developers to focus on skill appropriate
tasks - Reduce support, training, operations burden on IT
13Agenda
- What is WebLogic Workshop? (Cajun)
- Workshop architecture
- Design-time IDE
- Run-time Framework
- Java Web Service (JWS) Files
- Asynchronous web services framework
- Controls (CTRL Files)
- XML Mapping Script
14BEA WebLogic Workshop IDE
- Has two main views
- Design View visual metaphor for building a web
service - Used to paint a picture of a business events
execution - Developers hang business logic on picture without
worrying about objects and interfaces - Shows available operations, controls and element
properties - Source View where you write the code
- Syntax highlighting, auto completion, squiggly
underlined errors - Two-way code editing between views
- Creates a JWS file that defines the business
logic of a Web Service
15Workshop IDE Design View
16Workshop IDE Source View
17Cajun IDE Test ViewOverview
- Summary of web service operations
- WSDL, .CTRL, Java Proxy to invoke this web service
18Cajun IDE Test ViewConsole
- Internal operations (clear log, clear deployed
beans)
19Cajun IDE Test ViewTest Form
- Exercise all functions
- View a log of all messages in and out
20JWS Files
- Java Web Service (JWS) files link the design and
runtime environments - IDE generates little Java code
- Javadoc annotations before methods, classes, and
variables identify Workshop functionality
/ _at_jwsoperation _at_jwsconversation
phasestart _at_jwsmessage-buffer
enabletrue / public void getQuote(int age,
String gender, String ssn, int policyAmount) //
Your code goes here
21WebLogic Workshop Architecture
Workshop Run-time Framework
BEA WebLogic Server
JMS
EJBs
JDBC
JWS File Java code Annotation
Run-Time
Design Time
22Workshop Run-time Framework
- Reads the javadoc annotations in the JWS file and
generates the Web Service - JSP like model (compilation done for you)
- Automatically generates test environment, creates
WSDL description, Java proxy - Automatically handles deployment
- Produces standard EJB/J2EE under the hood
23Workshop Run-time Framework
- Generated code depends on sophistication of
service - Generally
- Stateless session bean handles web service
dispatch of incoming messages - Entity bean manages web service state
- Conversations, identify member variables should
be persisted - Message queue is created to support message
buffers and timer controls - Message driven bean supports message buffers
24Workshop Run-time Framework
- The runtime framework also handles many issues
not directly related to deploying a web service - Debugging (remote debugging against deployed web
service) - Conversion from JWS to CTRL or WSDL and visa
versa - Identifies design time errors for the IDE
25Agenda
- What is WebLogic Workshop? (Cajun)
- Workshop architecture
- Design-time IDE
- Run-time Framework
- Java Web Service (JWS) Files
- Asynchronous web services framework
- Controls (CTRL Files)
- XML Mapping Script
26JWS Java Web Service
- JWS files are Java classes that define business
logic for a single web service that include
WebLogic Workshop Javadoc extensions - Javadoc is an unobtrusive way to extend Java
without changing the language - Simple (developers dont have to maintain or try
to understand code they didnt write) - Rich in semantic meaning (use a message buffer,
make this conversational) - Tells the IDE what to display
- Tells the runtime what is needed to implement and
run - Working to make JWS a J2EE standard
27JWS Annotations
- Annotations can appear
- Before methods / callbacks
- Before service / control definition (i.e., before
Java class/interface) - Before control instances
- Always in a Javadoc comment / /
- Always apply to the Java thing that immediately
follows them. - Always begin with _at_jws
- Usually are of a tag/attribute format
- _at_jwstimer timeout5 seconds
28Property Summary Methods
- _at_jwsconversation Indicates how a method
participates in a conversation (stateless, start,
continue, finish) - _at_jwsmessage-buffer Indicates whether the method
should use a message buffer (JMS queue) - _at_jwsprotocol Indicates how this method receives
messages, via http, http forms, or JMS and how it
is enveloped, raw XML, SOAP-RPC, SOAP-doc/literal - _at_jwsparameter-xml / _at_jwsreturn-xml Indicates
how XML messages should be converted to Java and
visa versa
29Property Summary Service
- _at_jwsprotocol Same as for methods, but creates
default for service - _at_jwsconversation-lifetime Indicates a timeout
and max life time, after which conversational
state will be removed - _at_jwstarget-namespace Indicates the target
namespace for messages sent to this service
30Callback interface
- Two approaches to asynchronous messaging
- Polling every 5 seconds the client asks are
you done yet - Callbacks the web service proactively notifies
the client when an event occurs - Callbacks are implemented as a SOAP invocation
from service to client - i.e., there is a web service exposed at the
client as well - Handled through callback interface
31Agenda
- What is WebLogic Workshop? (Cajun)
- Workshop architecture
- Design-time IDE
- Run-time Framework
- Java Web Service (JWS) Files
- Asynchronous web services framework
- Controls (CTRL Files)
- XML Mapping Script
32Control Introduction
- Goal of controls is to make it easy for
developers who arent J2EE or Java experts - Simplifies APIs for the common case
- Exposes external resources in friendly ways
- Manages lifetime and shutdown
- All controls look like local objects with methods
and callbacks - Behavior of controls is customized through
properties Javadoc annotations as we have seen
so far
33Using Controls
- Using controls in JWS files is extremely simple
- A Java variable name
- Marked with _at_jwscontrol
- Thats it!
- Framework will instantiate control instance
- Framework will hookup callbacks
- Simple naming convention to handle callbacks from
controls - ltcontrolnamegt_ltcallbacknamegt(ltparametersgt)
- Ex delayTimer_onTimeout()
34Controls CTRL files
- CTRL files are Java interfaces that define the
interface to a control - 5 Control super-types
- Database, web service, timer, JMS, EJB
- CTRL file format used for all 5 types, but actual
CTRL file may look very different - Each CTRL file defines a specialized class of a
type of control extends the base interface - Each control class can be instantiated many times
35DB Control
- Database control lets you connect to any JDBC
data source - Data source must be predefined through WLS
console - Methods tie SQL statement to Java function
- Smart datatypes
- Key Properties
- _at_jwsconnection Sets JNDI name of datasource
- Methods look like
- / _at_jwssql statement"DROP TABLE customer" /
- public void dropCustomerTable()
36Timer Control
- Timer control provides an easy interface to time
events service gets callback when time elapses - Useful for rendezvous, timeouts, polling
- Generally not subclassed (i.e., no CTRL file)
- Key properties
- _at_jwstimer Used to set timeout and repeat times
- Key Functions
- start() starts a timer
- stop() stops a timer
- reset() resets the timer to the original state
37Service Control
- Gives access to any web service defined by a WSDL
Java interface on top of a WSDL - Works for both synchronous and asynchronous
services - Works with .NET, Apache, IBM, WLS web services
- Key Properties
- _at_jwslocation Defines the URL on which the
webservice is deployed - _at_jwswsdl A link to the WSDL that defines this
web service (usually inline) - Methods look like
- Basically the same as in a JWS file -same
properties same callback interface style
38EJB Control
- Makes locally and remotely deployed EJBs look
like local classes - Auto-creates session beans
- Caches bean instance for lifetime of control
- JNDI lookup and interface casting are unnecessary
- Key Properties
- _at_jwsejb Names home and remote interfaces
- Methods look like
- No methods! Interface extends from home and
remote interfaces of EJB
39JMS Control
- Makes it easy to send and receive messages from
JMS queues - Can use general purpose put/get or add named
functions with maps - Takes specific arguments and generates XML
document - Get callbacks when messages appear on queue
- Works with queues or topics
- Key properties
- _at_jwsjms Defines send and receive queue JNDI
names as well as JNDI name for connection factory - Methods look like
- Named methods with XML maps for the message, JMS
properties or both
40Agenda
- What is WebLogic Workshop? (Cajun)
- Workshop architecture
- Design-time IDE
- Run-time Framework
- Java Web Service (JWS) Files
- Asynchronous web services framework
- Controls (CTRL Files)
- XML Mapping Script
41XML Maps
- XML Maps were designed as a declarative way to
map from Java to XML and visa versa - Parameter-xml specifies how xml messages are
converted into parameters and visa versa - Return-xml specifies how xml messages are
transformed into the return value of a Java
method and visa versa - Simple variable substitution with syntax
42XML Maps (cont)
- Few special tags with XML maps beyond simple
value use - xmmultiple
- Allows you to handle repeating XML constructs
- /
- _at_parameter-xml xml-map
- ltordergt
- ltitem xmmultiple"String desc in
descriptions, int qty in quantities"gt - ltdescriptiongtdesclt/descriptiongt
- ltquantitygtqtylt/quantitygt
- lt/itemgt
- lt/ordergt
- /
- void submitOrder(String descriptions, int
quantities)
43XML Maps (cont)
- xmuse
- Allows you to call out to XML Script
- ltxmuse call"com.myco.MyScript.mymap(int a,
MyStructure b)"gt - OR
- com.myco.MyScript.mymap(int a, MyStructure b)
44XML Script
- XML Script is an enhanced version of XML script
that makes XML a native citizen - Goal is to avoid necessity of programming to the
DOM - Access XML like a class very natural syntax,
operator support, etc. - Invoke script with xmuse
- Two functions
- function fromXML (xml) Converts from XML to Java
- function toXML (args) Converts from Java args to
XML
45XML Data
- Problem Programming with XML directly is too
clumsy - Prior approach Automatic data binding
- SOAP RPC via XML
- XML Schema XML data types
- WSDL IDL for XML data
- JAXB Java-XML type serialization
- But Where is the data?
- The RPC trap hiding the data means exposing the
system implementation, and results in fragile
integration. - Just the opposite of the loose coupling that is
required!
46WebLogic Workshop Schedule
- Public beta happening now!
- Download from www.bea.com
- Workshop GA 1st half of 2002 (Late May)
- Pricing / Packaging will be announced at that time
47How business becomes e-business