View
979
Download
0
Category
Tags:
Preview:
Citation preview
1
Tools for SimplifyingTools for SimplifyingSOASOA
Sang ShinSang ShinSun Microsystems, Inc.Sun Microsystems, Inc.javapassion.comjavapassion.com
1
2
Topics• Types of SOA “NetBeans” Projects• Steps for building a “Hello World” composite
application
Types of SOA Types of SOA “NetBeans” Projects“NetBeans” Projects
4
Types of SOA “NetBeans” Projects• When creating a composite application, you typically
use the following types of SOA “NetBeans” projects:> BPEL Module project (NetBeans 6.0)> XSLT Module project (NetBeans 6.0)> SQL Module project (NetBeans 6.0)> Composite Application project (NetBeans 6.0)> IEP Module project (OpenESB package)> Worklist Module project (OpenESB package)> ETL (Extract, Transform, and Load) (OpenESB package)> EDM (Enterprise Data Mashup) (OpenESB package)
5
Types of SOA “NetBeans” Projects
6
BPEL Module Project• BPEL Module project is a group of source files
which includes > XML Schema (*.xsd) files> WSDL files> BPEL files
• Within a BPEL Module project, you can author a business process compliant with the WS-BPEL 2.0 language specification.• Will be added to a Composite application as a JBI
module
7
Composite Application Project• Composite Application project is a project whose
primary purpose is to assemble a deployment unit for the Java Business Integration (JBI) server > BPEL Module projects must be added to a Composite
Application project in order to be deployed to the BPEL runtime.
• The Composite Application Project can also be used to create and execute test cases that can then be run, in JUnit fashion, against the deployed BPEL processes.
8
Composite Application Project• With a Composite Application project, you can:> Assemble an application that uses multiple project types
(BPEL, XSLT, IEP, SQL, etc.)> Configure external/edge access protocols (SOAP, JMS,
SMTP, and others)> Build JBI deployment packages> Deploy the application image to the target JBI server> Monitor the status of JBI server components and
applications
Steps for Building aSteps for Building aSimple Composite Simple Composite Application: “Hello World” Application: “Hello World”
10
Steps for Building a Composite App.1.Create a “BPEL Module” NetBeans project2.Create XML Schema (as part of BPEL module)3.Create WSDL document (as part of BPEL module)4.Create BPEL process (as part of BPEL module)5.Create a “Composite Application” NetBeans project
➢ Add BPEL module6.Deploy the Composite application 7.Test the Composite application8.Debug the Composite application
Each step will be demonstrated!
You can try the demoYou can try the demoyourself.yourself.
http://www.javapassion.com/http://www.javapassion.com/handsonlabs/wscompositeappshandsonlabs/wscompositeapps
12
“Hello World” Composite Application• A very simple composite application> Receive a simple “Hello World” message and send it
back to the client• A simple XML schema> Same XML schema is used for describing the document
syntax of both request and response messages• A simple WSDL document (reflecting the BPEL
process to its client)> A simple synchronous request/response
• A simple BPEL process> Use a simple Receive->Assign->Reply
13
Step 1. Create “BPEL Module” NetBeans Project
14
Step 2. Create XML Schema• Use XML Schema designer (of NetBeans)> Visually analyze and edit XML Schema> Apply Design Patterns to XML Schema> Author complex XML Schema> Support for cross project XML file references> Schema based code completion for XML instances
15
XML Schema of “Hello World”<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/SynchronousSample" xmlns:tns="http://xml.netbeans.org/schema/SynchronousSample" elementFormDefault="qualified"> <xsd:complexType name="simpleProcess"> <xsd:sequence> <xsd:element name="paramA" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:element name="typeA" type="tns:simpleProcess"/></xsd:schema>
16
Step 3. Create WSDL document• Use WSDL Designer (of NetBeans)> Create WSDL files using graphical editor> Refactor across WSDL, XML and BPEL
17
WSDL Document of “Hello World”<definitions name="SynchronousSample"
targetNamespace="http://j2ee.netbeans.org/wsdl/SynchronousSample" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="http://xml.netbeans.org/schema/SynchronousSample" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://j2ee.netbeans.org/wsdl/SynchronousSample">
<types> <xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/SynchronousSample"> <xsd:import namespace="http://xml.netbeans.org/schema/SynchronousSample" schemaLocation="SynchronousSample.xsd"/> </xsd:schema> </types> <message name="SynchronousSampleOperationRequest"> <part name="inputType" element="ns:typeA"/> </message> <message name="SynchronousSampleOperationReply"> <part name="resultType" element="ns:typeA"/> </message>
18
WSDL Document of “Hello World” <portType name="SynchronousSamplePortType"> <wsdl:operation name="SynchronousSampleOperation"> <wsdl:input name="input1" message="tns:SynchronousSampleOperationRequest"/> <wsdl:output name="output1" message="tns:SynchronousSampleOperationReply"/> </wsdl:operation> </portType> <binding name="SynchronousSampleBinding" type="tns:SynchronousSamplePortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="SynchronousSampleOperation"> <soap:operation/> <wsdl:input name="input1"> <soap:body use="literal"/> </wsdl:input> <wsdl:output name="output1"> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </binding>
19
WSDL Document of “Hello World” <service name="SynchronousSampleService"> <wsdl:port name="SynchronousSamplePort" binding="tns:SynchronousSampleBinding"> <soap:address
location="http://localhost:18181/SynchronousSampleService/SynchronousSamplePort"/> </wsdl:port> </service> <plnk:partnerLinkType name="SynchronousSample1"> <!-- A partner link type is automatically generated when a new port type is added. Partner link types are used by BPEL processes. In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type. A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.--> <plnk:role name="SynchronousSamplePortTypeRole" portType="tns:SynchronousSamplePortType"/> </plnk:partnerLinkType></definitions>
20
Step 4. Create BPEL Process• Use BPEL Designer (of NetBeans)> Visually author BPEL 2.0 business processes> Easily Create XPath expressions in the BPEL Mapper
21
BPEL Document of “Hello World”<?xml version="1.0" encoding="UTF-8"?><process name="SynchronousSample" targetNamespace="http://enterprise.netbeans.org/bpel/SynchronousSample/SynchronousSample" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://enterprise.netbeans.org/bpel/SynchronousSample/SynchronousSample" xmlns:ns1="http://j2ee.netbeans.org/wsdl/SynchronousSample" xmlns:ns0="http://xml.netbeans.org/schema/SynchronousSample"> <import namespace="http://j2ee.netbeans.org/wsdl/SynchronousSample" location="SynchronousSample.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <partnerLinks> <partnerLink name="PartnerLink1" partnerLinkType="ns1:SynchronousSample1" myRole="SynchronousSamplePortTypeRole"/> </partnerLinks> <variables> <variable name="outputVar" messageType="ns1:SynchronousSampleOperationReply"/> <variable name="inputVar" messageType="ns1:SynchronousSampleOperationRequest"/> </variables>
22
BPEL Document of “Hello World” <sequence> <receive name="start" createInstance="yes" partnerLink="PartnerLink1" operation="SynchronousSampleOperation" portType="ns1:SynchronousSamplePortType" variable="inputVar"/> <assign name="Assign1"> <copy> <from>$inputVar.inputType/ns0:paramA</from> <to>$outputVar.resultType/ns0:paramA</to> </copy> </assign> <reply name="end" partnerLink="PartnerLink1" operation="SynchronousSampleOperation" portType="ns1:SynchronousSamplePortType" variable="outputVar"/> </sequence></process>
23
Step 5. Create “Composite Application” NetBeans Project
24
Add JBI Module• Adds a BPEL, XSLT, IEP, or SQL Module project to
the Composite Application project. > You must do this to deploy and test-run your Composite
Application> In the “Hello World” application, there is only one Module
to add
25
Step 6. Deploy the Composite Application• The Deploy action compiles the files in the
Composite Application project, packages the compiled BPEL and related web service artifacts (.wsdl and .xsd files), and deploys them to the BPEL Service Engine• Verify that the project has been successfully
deployed to the BPEL service engine
26
Step 7. Test the Composite Application• Create a Test case• Run the Test case
27
Step 8. Debug BPEL Process• Use BPEL Debugger (of NetBeans)> Create breakpoints> Monitor execution> Use Fault breakpoints> Use Watches
28
Tools for SimplifyingTools for SimplifyingSOASOA
Sang ShinSang ShinSun Microsystems, Inc.Sun Microsystems, Inc.
28
Recommended