Tools for Simplifying Tools for Simplifying SOA SOA


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Tools for Simplifying Tools for Simplifying SOA SOA

  1. 1. Tools for Simplifying SOA Sang Shin Sun Microsystems, Inc. 1
  2. 2. Topics • Types of SOA “NetBeans” Projects • Steps for building a “Hello World” composite application 2
  3. 3. Types of SOA “NetBeans” Projects
  4. 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) 4
  5. 5. Types of SOA “NetBeans” Projects 5
  6. 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 6
  7. 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. 7
  8. 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 8
  9. 9. Steps for Building a Simple Composite Application: “Hello World”
  10. 10. Steps for Building a Composite App. 1.Create a “BPEL Module” NetBeans project 2.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 module 6.Deploy the Composite application 7.Test the Composite application 8.Debug the Composite application Each step will be demonstrated! 10
  11. 11. You can try the demo yourself. handsonlabs/wscompositeapps
  12. 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 12
  13. 13. Step 1. Create “BPEL Module” NetBeans Project 13
  14. 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 14
  15. 15. XML Schema of “Hello World” <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="" targetNamespace="" xmlns:tns="" 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> 15
  16. 16. Step 3. Create WSDL document • Use WSDL Designer (of NetBeans) > Create WSDL files using graphical editor > Refactor across WSDL, XML and BPEL 16
  17. 17. WSDL Document of “Hello World” <definitions name="SynchronousSample" targetNamespace="" xmlns="" xmlns:wsdl="" xmlns:xsd="" xmlns:ns="" xmlns:plnk="" xmlns:soap="" xmlns:tns=""> <types> <xsd:schema targetNamespace=""> <xsd:import namespace="" 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> 17
  18. 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=""/> <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> 18
  19. 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> 19
  20. 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 20
  21. 21. BPEL Document of “Hello World” <?xml version="1.0" encoding="UTF-8"?> <process name="SynchronousSample" targetNamespace=" xmlns="" xmlns:xsd="" xmlns:tns="" xmlns:ns1="" xmlns:ns0=""> <import namespace="" location="SynchronousSample.wsdl" importType=""/> <partnerLinks> <partnerLink name="PartnerLink1" partnerLinkType="ns1:SynchronousSample1" myRole="SynchronousSamplePortTypeRole"/> </partnerLinks> <variables> <variable name="outputVar" messageType="ns1:SynchronousSampleOperationReply"/> <variable name="inputVar" messageType="ns1:SynchronousSampleOperationRequest"/> </variables> 21
  22. 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> 22
  23. 23. Step 5. Create “Composite Application” NetBeans Project 23
  24. 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 24
  25. 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 25
  26. 26. Step 7. Test the Composite Application • Create a Test case • Run the Test case 26
  27. 27. Step 8. Debug BPEL Process • Use BPEL Debugger (of NetBeans) > Create breakpoints > Monitor execution > Use Fault breakpoints > Use Watches 27
  28. 28. Tools for Simplifying SOA Sang Shin Sun Microsystems, Inc. 28