28
1 Tools for Simplifying Tools for Simplifying SOA SOA Sang Shin Sang Shin Sun Microsystems, Inc. Sun Microsystems, Inc. javapassion.com javapassion.com 1

Tools for Simplifying Tools for Simplifying SOA SOA

  • Upload
    zubin67

  • View
    967

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Tools for Simplifying Tools for Simplifying SOA SOA

1

Tools for SimplifyingTools for SimplifyingSOASOA

Sang ShinSang ShinSun Microsystems, Inc.Sun Microsystems, Inc.javapassion.comjavapassion.com

1

Page 2: Tools for Simplifying Tools for Simplifying SOA SOA

2

Topics• Types of SOA “NetBeans” Projects• Steps for building a “Hello World” composite

application

Page 3: Tools for Simplifying Tools for Simplifying SOA SOA

Types of SOA Types of SOA “NetBeans” Projects“NetBeans” Projects

Page 4: Tools for Simplifying Tools for Simplifying SOA SOA

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)

Page 5: Tools for Simplifying Tools for Simplifying SOA SOA

5

Types of SOA “NetBeans” Projects

Page 6: Tools for Simplifying Tools for Simplifying SOA SOA

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

Page 7: Tools for Simplifying Tools for Simplifying SOA SOA

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.

Page 8: Tools for Simplifying Tools for Simplifying SOA SOA

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

Page 9: Tools for Simplifying Tools for Simplifying SOA SOA

Steps for Building aSteps for Building aSimple Composite Simple Composite Application: “Hello World” Application: “Hello World”

Page 10: Tools for Simplifying Tools for Simplifying SOA SOA

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!

Page 11: Tools for Simplifying Tools for Simplifying SOA SOA

You can try the demoYou can try the demoyourself.yourself.

http://www.javapassion.com/http://www.javapassion.com/handsonlabs/wscompositeappshandsonlabs/wscompositeapps

Page 12: Tools for Simplifying Tools for Simplifying SOA SOA

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

Page 13: Tools for Simplifying Tools for Simplifying SOA SOA

13

Step 1. Create “BPEL Module” NetBeans Project

Page 14: Tools for Simplifying Tools for Simplifying SOA SOA

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

Page 15: Tools for Simplifying Tools for Simplifying SOA SOA

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>

Page 16: Tools for Simplifying Tools for Simplifying SOA SOA

16

Step 3. Create WSDL document• Use WSDL Designer (of NetBeans)> Create WSDL files using graphical editor> Refactor across WSDL, XML and BPEL

Page 17: Tools for Simplifying Tools for Simplifying SOA SOA

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>

Page 18: Tools for Simplifying Tools for Simplifying SOA SOA

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>

Page 19: Tools for Simplifying Tools for Simplifying SOA SOA

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>

Page 20: Tools for Simplifying Tools for Simplifying SOA SOA

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

Page 21: Tools for Simplifying Tools for Simplifying SOA SOA

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>

Page 22: Tools for Simplifying Tools for Simplifying SOA SOA

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>

Page 23: Tools for Simplifying Tools for Simplifying SOA SOA

23

Step 5. Create “Composite Application” NetBeans Project

Page 24: Tools for Simplifying Tools for Simplifying SOA SOA

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

Page 25: Tools for Simplifying Tools for Simplifying SOA SOA

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

Page 26: Tools for Simplifying Tools for Simplifying SOA SOA

26

Step 7. Test the Composite Application• Create a Test case• Run the Test case

Page 27: Tools for Simplifying Tools for Simplifying SOA SOA

27

Step 8. Debug BPEL Process• Use BPEL Debugger (of NetBeans)> Create breakpoints> Monitor execution> Use Fault breakpoints> Use Watches

Page 28: Tools for Simplifying Tools for Simplifying SOA SOA

28

Tools for SimplifyingTools for SimplifyingSOASOA

Sang ShinSang ShinSun Microsystems, Inc.Sun Microsystems, Inc.

28