--------------This column by Chichi students to broadcast-------------
======= also thanks to the download space provided by the 115 network disk =======
After reading, please click on the "Top" below the page ************
I. Configuring the BPEL development environment
Need to install BPEL plug-ins in Eclipse EE
Reference: http://blog.csdn.net/xiaoanian/article/details/7080015
Two. BPEL project configuration
1. Build a BPEL project
2. Add bpel file
Note Template must choose synchronous BPEL Process
Service address is a future location to be deployed to BPS (...). Because this property is used in a separate operation, and we are in the BPS, do not know if you can easily fill in
3. Add WSDL for HelloService in Application server
In order to use HelloService, we need to use its WSDL file.
Open HelloService WSDL1.1 (cannot use WSDL2), Save as Helloservice.wsdl
Copy helloservice.wsdl to engineering bpelcontent directory
Add <bpel:import> tag in Helloserviceprocess.bpel, import helloservice.wsdl into, note that its name space is HELLOSERVICE.WSDL TargetNamespace specified in
Three. Add a name space
1. Add xmlns:plnk name space in helloservice.wsdl, copy from HELLOSERVICEPROCESSARTIFACTS.WSDL.
2. Add xmln:ns name space in Helloserviceprocess.bpel , copy from HELLOSERVICE.WSDL.
The name space is actually the targetnamespacespecified in the helloservice.wsdl .
It is copied into BPEL to refer to the HELLOSERVICE.WSDL definition element (similar to the Java import).
If you want to add more WSDL, this step is also indispensable, and to ensure that the namespace prefix unique, such as not in different WSDL
All appear xmln:ns and point to different name spaces.
In view of Xxx,lcx,cy,gg and other fighting in the fight against chichi front-line Labor women are very puzzled about the name space, and take into account the horror of the run Fung will certainly confused, special paste a picture
To explain the name space.
Four. Add code
1. Add <plnk:partnerlinktype> to helloservice.wsdl; that's why we just added Xmlns:plnk name space.
Let's go down to Helloserviceprocess.bpel.
2. Add <bpel:partnerlink> to <bpel:partnerLinks>, point to Partnerlinktype in helloservice.wsdl
Attention is partnerrole rather than myrole.
3. Add intermediate variables in <bpel:variables> as HelloService input and output
4. Add <bpel:invoke> in <bpel:sequence>, add to <bpel:receive> and <bpel:reply>
This step is to invoke the HelloService service of the app server
5. Click the design at the bottom left of the edit window, we see the following process
6. Return to source and add the message type Conversion module. Because the entire process input variable is "input" (Type is tns:helloserviceprocessrequestmessage, defined in helloserviceprocessartifacts.wsdl), and the input of the HelloService service we invoke is "Service_input" (Type is ns:greetrequest, defined in helloservice.wsdl), so you must do type conversion. The conversion of the type uses the <BPEL:ASSIGN> This process is relatively complex, it is not appropriate to write code manually, need to generate automatically. We'll start with <bpel:invoke> Add <bpel:assign> before and after, named Assigninput and Assignoutput, do not fill in any content, now we see the error, does not matter, look down
7. Click Design to do the following
Edit Assigninput
Edit Assignoutput
8. Add Deploy.xml
Right-bpelcontent folder->new->others->bpel2.0->apache ODE deployment descriptor, Next->finish
Double-click to open,
The associated Port column in the client row selects Helloserviceprocessport, and the other columns are automatically completed
Select Helloservicehttpsoap11endpoint in the associated port column of the Helloservicebpellink line, and the other columns are automatically completed
Save.
All right, the whole BPEL thing's ready.
Note that if you change the bpel,wsdl file, be sure to synchronize the update deploy.xml as follows: Click on the top right link associated BPEL ... update!
Five. Package and upload
1. Into the project folder under the Beplcontent, the 5 files packaged into a zip file
2. Enter bps, enter main/business process/add BPEL, upload file
Note that if you have deployed services with the same service name, you must first enter the Main/business process/deployed Packages and undepoly off the previous service.
3. OK, we see a helloserviceprocess in the Web services/list list
Six. Manual Wsdl2java
Because the Generate client error in bps (do not believe you choose a BEPL service to try), so we have to manually generate Java files.
Need to use axis-1.6.1 package, download address http://axis.apache.org/axis2/java/core/download.cgi
If you used to use a client, you'd probably have already.
After decompression, we go into its bin directory
Enter the following command:
Wsdl2java.bat-uri Http://192.168.10.111:9766/services/HelloServiceProcess?wsdl-o./temp-t
The URI is the wsdl1.1 address of your bps helloserviceprocess. "-O./temp" means that the generated code is under the Temp folder (established first)
After the build is successful, you can copy the two Java files into the client's project using the
Seven. Use client
Assuming our name is Kongbuderunfeng, the result is this.
Eight. SOURCE download
Helloserviceprocess BPEL project, which can be imported directly into eclipse. (BPEL plugin required)
Http://115.com/file/e6p3ybm8#HelloServiceProcess_EclipseEE_Project.rar
Helloserviceprocesclient project, can be directly imported into eclipse
Http://115.com/file/e6p3yo2b#HelloServiceProcessClient_EclipseEE_Project.rar
Nine. Summary
BPS can be used to connect a variety of services and define processes in a similar manner.
One thing to be aware of is the reference to a namespace. Also useful <bpel:invoke> when invoking other services it is troublesome to use <bepl:assign> for type conversion and assignment, which is a good step to automatically generate a program