Building Composite Applications
In this lab, you are going to build a simple composite
applications step by step. The hands-on labs were
created based on
Developing
a Hello World Composite Application tutorial from
netbeans.org from netbeans.org.
Expected duration: 60 minutes
(excluding homework)
Software Needed
- Java Standard Development Kit (JDK™) 6.0 (download)
- Select JDK 6 Update x
from the download page (The JDK 6 update 4 and after now uses JAX-WS
2.1)
- NetBeans IDE 6.1 (download)
- Download either "Web &
Java EE" or "All"
bundles.
- 4371_wscompositeapps.zip (download)
- It contains this document and the lab contents
- Download it and unzip in a directory of your choice
OS platforms you can use
- Windows
- Solaris x86, Solaris Sparc
- Linux
- Mac OS X
Change Log
- Aug. 10th, 2007: Created
- Jan. 15th, 2008: Homework is added
- June 7th, 2008: NetBeans 6.1 picture is added for adding client
to BPEL
- Sep. 14th, 2008: Homework does not need to send WSMonitor screen
Things to do (by Sang Shin)
- More explanation of the excercise is needed
- XSLT module exercise needs to be added
Lab Exercises
Exercise 1: Create BPEL Module project and
a simple Composite Application
(1.1)
Create a "BPEL Module" NetBeans
project
0. Start NetBeans IDE.
1. Create SynchronousSample
SOA project.
- Select File->New Project.
- Observe that the New Project
dialog box appears.
- Select SOA under Categories and select BPEL Module under Projects.
- Click Next. (Figure-1.11
below)

Figure-1.11: Create BPEL Module
- Observer that the New BPEL
Module dialog box appears.
- For the Project Name
field, enter SynchronousSample.
- Click Finish.
(Figure-1.12 below)

Figure-1.12: Name and Location
(1.2)
Create XML Schema
1. Create
SynchronousSample.xsd.
- Right click Process Files
and select New->Other.
(Figure-1.21 below) (Or you can
select New->XML Schema if
XML Schema is already in the pop-up menu.)

Figure-1.21: Select Other
- Observe that the Choose File
Type pane appears.
- Select XML
under Categories and XML Schema
under File Types.
- Click Next. (Figure-1.22
below)

Figure-1.22: Create XML Schema
- Observe that the New XML Schema
pane appears.
- For the File Name field,
enter SynchronousSample.
- Click Finish.
(Figure-1.23 below)

Figure-1.23: Name and Location
2. Add a
Complex Type to the
XML schema.
- Select Window->Palette
(if Palette window is not displayed already). (Figure-1.24 below)
If you already have a Palette, you can skip this action.

Figure-1.24: Display Palette (if it has not been displayed)
- Select Design tab
window.
- Drag the Complext Type
from the Palette and drop it
under the Complex Types in the
design
window.
- Set the name of the newly added Complex Type to simpleProcess.
(Figure-1.25 below)
(You can always
change the name of it to something else later on through Name property
under Properties window.)

Figure-1.25: Add a Complex Type to the schema
3. Add a local element to
simpleProcess
complex type
- Drag the Element under XML Component section and drop it
under the simpleProcess complex
type.
- Change the name of the newly added Element to paramA. (Figure-1.26 below)

Figure-1.26: Add a local element to the complex type
- Select Window->Properties
to display Properties window.
(Needed only when the Properties window is not already displayed.)

Figure-1.27: Display Properties window
- Observe that the Properties dialog box of the paramA is displayed.
- Click ... of the Definition property of the paramA. (Figure-1.28 below)
This is to set
the value of the type attribute
of the paramA element.

Figure-1.28: Select a definition of the element
- Observe that the Element's
definition dialog box appears.
- Expand the Built-in Types.
(Figure-1.29 below)

Figure-1.29: Expand Built-in Types
- Select string.
- Click OK.
(Figure-1.30 below)

Figure-1.30: Select string
- Observe that the paramA element
has string type notation in
the design window. (Figure-1.31 below)

Figure-1.31: paramA has string as a definition
- Click Source tab window
to display the SynchronousSample.xsd
in the source format.
- Study the XML schema. Note the ComplexType whose name is simpleProcess is defined.
(Figure-1.32 below)

Figure-1.32:Display XML schema
4. Add a global element to the schema.
- Drag the Element from
the Palette and drop it to the design area, immediately below the Elements node. (Figure-1.33
below)

Figure-1.33: Add a global element
- Change the name to typeA.
(Figure-1.34
below)

Figure-1.34: typeA global element
- Right click typeA figure
and select Properties.
- click ,,, box the Definition property.
- Observe that the Element's
definition dialog box appears.
- Select simpleProcess under
Complex Types. This
will set the value of the type attribute
of the typeA global element
to simpleProcess.
- Click OK. (Figure-1.35
below)

Figure-1.35: Select simpleProcess as a definition
- Click Close button of the Properties dialog box to close it.
- Observe that the typeA global
element has simpleProcess type
in
the design window. (Figure-1.36 below)

Figure-1.36: typeA global element is type of simpleProcess
complex type
5. Save all the changes.
- Click Save All icon.
(Figure-1.37 below)

Figure-1.37: Save all the changes
6. Display and study the XML schema file.
- Click Source tab window.
- Make sure the source code looks as in Code-1.38 below.
<?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>
|
Code-1.38: XML schema file
return
to top of the exercise
(1.3)
Create WSDL document
In this step, you are going to create a WSDL document of the Web
services that represents the BPEL process. (BPEL process, to its
client, is a Web service, which means BPEL process has to have its own
WSDL document.)
1. Create WSDL Document.
- Right click project node and select New->WSDL Document. (Figure-1.39
below)

Figure-1.39: Create WSDL document
- Observe that the New WSDL
Document dialog box appears.
- For the File Name field,
enter SynchronousSample.
- Select Import XML Schema File(s)
and click Browse. (Figure-1.40
below)

Figure-1.40: Name and Location
- Observe that the Add Import
dialog box appears.
- Expand By File->SynchrousSample->Process
Files and select SynchronousSample.xsd.
(Figure-1.41 below)
- Click OK.

Figure-1.41: Add Import
- Observe that the XML Schema(s)
field is filled up.
- Click Next. (Figure-1.42
below)

Figure-1.42: Name and Location
- Observe that the New WSDL
Document dialog box appears.
- Change the value of the Message
Part Name field of Input section
from part1 to inputType.
- Click ... of the Element or Type. (Figure-1.43 below)

Figure-1.43: Abstract Configuration
- Observe that the Select Element
or Type dialog box appears.
- Expand SynchronousSample->src/SynchronousSample.xsd->Elements.
- Select typeA.
(Figure-1.44 below)

Figure-1.44: Select Element Or Type
- Observe that the Element or Type
field is now set with ns:typeA.
(Figure-1.45 below)

Figure-1.45: Abstract Configuration - Input
- Change the Message Part Name
of the Output section to resultType
(from part1) and set the Element Or Type to ns:typeA as you've doen with the
Input above.
- Click Next. (Figure-1.46
below)

Figure-1.46: Abstract Configuration - Output
- Select Document Literal
as Binding Subtype. Note
that Document Literal is the recommended style from WS-I.
- Click Finish.
(Figure-1.47 below)

Figure-1.47: Document Literal
- Observe that the Process Files
node now has SynchronousSample.wsdl.
(Figure-1.48 below)

Figure-1.48: SynchronousSample.wsdl
- Click Source tab and
study the WSDL document in the source file
format. (Code-1.49 below)
<?xml version="1.0"
encoding="UTF-8"?>
<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>
<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>
<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>
|
- Click Partner tab and
observe the Partner Link Types.
and Messages. (Figure-1.50
below)
Figure-1.50: Partner
(1.4)
Create BPEL process
In this step,
you are going to create SynchronousSample.bpel.
1. Create a empty
SynchronousSample.bpel.
- Right click Process Files
and select New->BPEL Process.
(Figure-1.51 below)

Figure-1.51: Ceate BPEL Process
- Observe that the New BPEL
Process dialog box appears.
- For File Name field,
enter SynchronousSample.
- Click Finish.
(Figure-1.52 below)

Figure-1.52: Name and Location
- Observe that the SynchronousSample.bpel
is displayed in Design mode.
(Figure-1.53 below)

Figure-1.53: BPEL design mode
2. Add a partner link.
- Drag Synchronous.wsdl
from the Projects window to the Design view. (Figure-1.54 below - two
Figures, one for NetBeans 6.1 and the other for NetBeans 6.0.1)

Figure-1.54: Drag SynchronousSample.wsdl to the design view (if you are
using NetBeans 6.1)
<>Observe that the PartnerLink1
is
now displayed in the Design window. (Figure-1.56 below)

Figure-1.56: Fit diagram
3. Add a Receive activity
- Drag Receive and drop
it into the design area between the
Process Start
activity and the Process End
activity.
- Observe that the IDE provides you with visual clues to show you
where you can drop the selection. (Figure-1.57 below)

Figure-1.57: Add Receive BPEL activity
- Observe that the BPEL Receive activity
called Receive1 appears in the
Design view. (Figure-1.58 below)

Figure-1.58: Receive1 is added
- Double-click the Receive1 activity.
- Observe that the Receive1
[Receive] - Property Editor
opens.
- Change the value in the Name field
to start.
- Click the Create button
next to the Input Variable
field. (Figure-1.59 below)

Figure-1.59: Receive1 Property Editor
- The New Input Variable
dialog box opens.
- Change the value in the Name field to inputVar. (Figure-1.60 below)
- Click Ok.

Figure-1.60: New Input Variable
- Click OK to close the Receive1
[Receive] - Property Editor. (Figure-1.61 below)

Figure-1.61: Property Editor
- The Receive activity is now labeled start in the Design
view. (Figure-1.62 below)

Figure-1.62: Receive activity is added
- Click source tab window to display the source of the SynchronousSample.bpel. (Code-1.63
below)
<?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">
<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="inputVar"
messageType="ns1:SynchronousSampleOperationRequest"/>
</variables>
<sequence>
<receive name="start"
createInstance="yes"
partnerLink="PartnerLink1"
operation="SynchronousSampleOperation"
portType="ns1:SynchronousSamplePortType"
variable="inputVar"/>
</sequence>
</process>
|
Code-1.63: SynchronousSample.bpel
4. Add a
Reply activity
- Select the Reply icon
and drag your selection to the design area
between the Receive activity and the Process End activity.
- Observe that the IDE provides you with visual clues to show you
where you can drop the selection. (Figure-1.64 below)

Figure-1.64: Add Reply Activity
- Double-click the Reply1 activity.
- Observe that the Reply1 [Reply]
- Property Editor opens.
- Change the value in the Name field
to end.
- From the Partner Link drop-down list, select PartnerLink1. (Figure-1.65 below)
- Click the Create button
next to the Output Variable
field.

Figure-1.65: Property Editor
- The New Output Variable
dialog box opens.
- Change the value in the Name field to outputVar. (Figure-1.66 below)
- Click Ok.

Figure-1.66: New Output Variable
- Observe that the link from end to the PartnerLink1. (Figure-1.67 below)

Figure-1.67: Reply activity is added
- Click Source tab window to display the BPEL document.
- Observe the newly added lines in bold-font to the document.
(Code-1.68 below)
<?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">
<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>
<sequence>
<receive name="start"
createInstance="yes"
partnerLink="PartnerLink1"
operation="SynchronousSampleOperation"
portType="ns1:SynchronousSamplePortType"
variable="inputVar"/>
<reply name="end"
partnerLink="PartnerLink1"
operation="SynchronousSampleOperation"
portType="ns1:SynchronousSamplePortType"
variable="outputVar"/>
</sequence>
</process>
|
Code-1.68: Interim SynchronousSample.bpel
5. Add an Assign activity
- Drag the Assign and
drop into the design area between the
start activity and the end
activity. (Figure-1.69 below)

Figure-1.69: Ass Assign activity
- Observe that the Assign
activity is now displayed.
- Observe also that the BPEL Mapper window is displayed in the
bottom of the IDE.
- In the left pane of the BPEL
Mapper, under Variables,
expand the inputVar and inputType nodes.
- Observe that the paramA
appears under inputType.
- In the right pane of the BPEL
Mapper, under Variables,
expand the outputVar and resultType nodes.
- Observe that the paramA appears
under resultType.
- Drag paramA from the left
pane of the BPEL Mapper to the
paramA node in the right
pane of the BPEL Mapper. This
assignment copies the input statement into the output. (Figure-1.70
below)

Figure-1.70: Assign activity is added
- Click Source tab window
to display the BPEL document.
- Observe the newly added lines in bold-font to the document.
(Code-1.71 below)
<?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>
<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>
|
Code-1.71: SynchronousSample.bpel
So far, what you have done is to create BPEL module project. This
BPEL module needs to be added to a Composite application before it can
be deployed and executed, which you will do in the subsequent steps.
return
to top of the exercise
(1.5)
Create a "Composite Application" NetBeans project
In this step, you are going to creates an empty Composite Application
project, which may include multiple BPEL Modules and other types of
Java Business Integration (JBI) modules.
1. Create an empty Composite Application
- Select File->New Project.
- Observe that the New Project
dialog box appears.
- Select SOA under Categories and select Composite Application under Projects. (Figure-1.81 below)

Figure-1.81: Create Composite Application
- Observe that the Name and
Location pane appears.
- For Project Name field,
enter SynchronousSampleApplication.
- Click Finish.
(Figure-1.82 below)

Figure-1.82: Name and Location
2. Add JBI Modules
- Right click SynchronousSampleApplication
project node and select Add
JBI module. (Figure-1.83 below)

Figure-1.83: Add JBI Module
- Observe that the Select Project
dialog box appears.
- Select SynchronousSample.
- Click Add Project JAR Files button. (Figure-1.84
below)

Figure-1.84: Add Project JAR Files
- Expand JBI Modules.
- Observe that the SynchronousSample.jar
is under JBI Modules
node. (Figure-1.85 below)

Figure-1.85: JBI Module is added to the Composite Application
return
to top of the exercise
(1.6)
Deploy the Composite application
1. Right click
SynchronousSampleApplication
project node and select
Deploy.
(Figure-1.91 below)

Figure-1.91: Deploy the application
2. Observe that the "
BUILD
SUCCESSFUL (total time: 4 seconds)"
message gets displayed in the Output window. (Figure-1.92 below)

Figure-1.92: Observe that the application is deployed
3. Verify the Composite application is deployed.
- Click Services tab
window.
- Expand Servers->GlassFish
V2->JBI->Service Assemblies.
- Observe that the SynchronousSampleApplication
is present.
- Expand SynchronousSampleApplication.
- Observe SynchronousSampleApplication
contains SynchronousSample
BPEL module and sun-http-binding Binding
Component. (Figure-1.93 below)

Figure-1.93: SynchronousSampleApplication
return
to top of the exercise
(1.7)
Test the Composite application
You can enhance the Composite Application project by adding test cases,
binding to the operation, supplying input, and then using the Tester.
1. Right click
Test under
SynchronousSampleApplication project
node and
select
New Test Case.
(Figure-1.95 below)

Figure-1.95: New Test Case
2. Observe that the
New Test Case
dialog box appears.
3. Click
Next.
(Figure-1.96 below)

Figure-1.96: Enter the Test Case Name
4. Observe that the
Select the WSDL
Document pane appears.
5. Expand
SynchronousSample - Source
Pacakges and select
SynchronousSample.wsdl.
6. Click
Next. (Figure-1.97
below)

Figure-1.97: Select the WSDL Document
7. Observe that the
Select the
Operation to Test pane appears.
8. Select
SynchronousSampleOperation.
9. Click
Finish.
(Figure-1.98 below)

Figure-1.98: Select the Operation to Test
10. Double click Input under
Test->TestCase1
to open in the source
editor.
11. Change the
?string? to
Hello World.
(Figure-1.99 below)

Figure-1.99: Change string
12. Right click
TestCase1 and
select
Run. (Figure-1.100
below)

Figure-1.100: Run the Test case
13. Observe that the
Overwrite
Empty Output? dialog box appears,
14. Click
Yes.
(Figure-1.101 below)

Figure-1.101: Confirmation
15. Observe that the
Output.xml
is filled with the SOAP response
message. You will also note that the Output window indicates a
failure. This is expected since for the first test, there was no
Output.xml defined. From the subsequent steps, it will result in a
success since we defined the Output.xml in the previous step.
(Figure-1.102 below)

Figure-1.102: Output.xml
16. Right click
TestCase1 and
select
Run. (Figure-1.103
below)

Figure-1.103: Run the TestCase1
17. Observe that the test is passed. (Figure-1.104 below)

Figure-1.104: TestCase1 passed
return
to top of the exercise
(1.8)
Debug the Composite application
1. Make a break point in the BPEL process.
- Display the line number.
- Click in the left gray bar (where the line number is displayed)
of the line number 18. It will set a breakpoint. (Figure-1.81
below)

Figure-1.81: Make a breakpoint
2. Change the timeout value (from 30 seconds to 200 seconds)
- Right click TestCast1
and select Properties.
(Figure-1.82 below)

Figure-1.82: Display Properties of TestCase1
- Change the value of the Test
Timeout (sec) from the default value
of 30 to 200 (or whatever seconds you want to use). (Figure-1.,83 below)

Figure-1.83: Change timeout value
3. Run the BPEL process in the Debug mode.
- Right click TestCase1
and select Debug. (Figure-1.84
below)

Figure-1.84: Debug the TestCase`1
- Observe that the breakpoint is hit. (Figure-1.85 below)

Figure-1.85: Breakpoint is hit
4. Finish the test.
- Select Run from top-level menu and then select Continue.
(Figure-1.86 below)
Summary
In this exercise, you have
built a simple "Hello World" composite application in which a
BPEL process which receives a request message and echos it back to the
client is included.
return to
the top
Homework
Exercise (for people
who
are taking Sang Shin's "Web Services & SOA Programming online
course")
1. The homework is to
build a composite application as
following:
- The BPEL process represents
HelloWebService, in which a
client sends a name and the BPEL process responses with Hello, <name>!.
- Build the XML schema as Hello.xsd.
- Build the WSDL document as Hello.wsdl
- Build the BPEL document as Hello.bpel
- Build composite application as HelloApplication.
- Test the application.
Hint: Provided by one of the attendees of this course. (Thanks, Tim)
"One of your provided links, A Simple Synchronous BPEL Process,
http://www.netbeans.org/kb/60/soa/synchsample.html#addingassign,
has an excellent example of how to receive data, manipulate it and
return it. There is even a screen shot of how to hook things up.
In fact, it is the solution to the homework exercise. Here is an
excerpt:
3 Select new Assign2 activity.
4 From the Method Palette of the Mapper, click String method and select
the concat Concat from the String drop-down list. The concat method
appears in the middle portion of the Editor.
5 Double-click the first field in the concat box and type Hello
followed by space in the first string. Press the Enter key.
6 From the left side of the Mapper, expand inputVar > inputType.
7 Drag paramA onto the string2 part of the concat method, the second
field.
8 From the right of the Mapper, expand outputVar > resultType.
9 Drag the return string from the concat method onto the paramA under
outputVar > resultType. This concatenates the string Hello to the
input and copies the statement into the output."
2. Send the following files to
webserviceshomework@sun.com
with
Subject as
WebServices-wscompositeapps.
- Zip file of the the
HelloWebService
NetBeans project. (Someone else
should be able to open and run it as a NetBeans project.) You can
use your favorite zip utility or you can use "jar" utility that comes
with JDK as following.
- cd <parent directory that contains HelloWebService directory>
(assuming you named your project as HelloWebService)
- jar cvf HelloWebService.zip HelloWebService (HelloWebService should contain nbproject directory)
- Captured screen -
name it as WebServices-wscompositeapps.gif
orWebServices-wscompositeapps.jpg (or WebServices-wscompositeapps.<whatver
graphics format>)
- Any captured screen that shows you did your work should be
sufficient