-------------- This topic is specially broadcasted by ChiChi students -------------
============At the same time, I would like to thank the download space provided by the 115 Network Disk ========
* ************ Click "TOP" ************** at the bottom of the page "************
1. Configure the BPEL Development Environment
Install the BPEL plug-in Eclipse EE
Reference: http://blog.csdn.net/xiaoanian/article/details/7080015
2. Configure the BPEL Project
1. Establish a BPEL Project
2. Add a BPEL File
Note that you must select Synchronous BPEL Process for Template.
Service Address is the Address that will be deployed on BPS in the future (...... because this attribute is used for separate running, and we use it in BPS. I don't know if I can fill it out)
3. Add the WSDL of helloservice in Application Server
To use HelloService, we need to use its WSDL File
Open WSDL1.1 of HelloService (WSDL2 cannot be used) and save it as HelloService. wsdl
Copy HelloService. wsdl to the bpelContent directory of the project.
Add the <bpel: import> tag to HelloServiceProcess. bpel to import HelloService. wsdl,
Note that the namespace is specified by targetNamespace in HelloService. wsdl.
3. Add namespace
1. Add the xmlns: plnk namespace to helloservice. WSDL,Copied from HelloServiceProcessArtifacts. wsdl
2. Add the xmln: NS namespace in helloserviceprocess. BPEL., Copied from HelloService. wsdl.
This namespace is actuallyHelloservice. WSDLSpecified inTargetnamespace.
The definition elements of HelloService. wsdl can be referenced (similar to java import ).
If you want to add more wsdl, this step is also indispensable, and you must ensure that the namespace prefix is unique, for example, it cannot be in different wsdl
Xmln: ns appears and points to different namespaces.
Given the fact that xxx, lcx, cy, And gg are fighting against the chichi industry, working women are very confused about the namespace. Considering the terror of run Feng, they will certainly be confused, posting a special figure
To explain the namespace.
4. Add code
1. Add <plnk: partnerlinktype> In helloservice. WSDL, which is why we just added xmlns: plnk namespace.
Next we will go to HelloServiceProcess. bpel.
2. Add <BPEL: partnerlinks> to point to partnerlinktype in helloservice. WSDL.
Note that partnerRole is not myRole.
3. Add the intermediate variable in <BPEL: variables> as the input and output of helloservice.
4. in <BPEL: sequence>, add <BPEL: invoke> between <BPEL: receive> and <BPEL: reply>.
This step is to call the HelloService service of the App Server.
5. Click design in the lower-left corner of the editing window. The following process is displayed:
6. return to Source and add the message type conversion module. because the input variable of the entire process is "input" (type: tns: HelloServiceProcessRequestMessage, in HelloServiceProcessArtifacts. (defined in wsdl), and the input of the HelloService we call is "service_input" (type: ns: greetRequest, in HelloService. (defined in wsdl), So type conversion is required. <bpel: assign>. this process is relatively complex. It is not recommended to write code manually and must be generated automatically. we first add <bpel: assign> before and after <bpel: invoke> to get the names assignInput and assignOutput without filling in any content. Now we see an error. It doesn't matter. Let's look down.
7. Click design to perform the following operations:
Edit assignInput
Edit assignOutput
8. Add deploy. xml
Right-click the bpelContent folder-> new-> others-> BPEL2.0-> Apache ODE Deployment Descriptor, next-> finish
Double-click to open,
Select HelloServiceProcessPort in the Associated Port column of the client line. Other columns are automatically completed.
Select HelloServiceHttpSoap11Endpoint in the Associated Port column of helloServiceBpelLink. Other columns are automatically completed.
Save.
All right, the whole BPEL is deployed.
Note: If you change the bpel and wsdl files, you must synchronously update deploy. xml as follows: click the link in the upper-right corner.Associated BPEL ...... update!
5. Package and upload
1. Enter beplContent in the project folder and pack the five files into a zip file.
2. Enter BPS, Enter main/Business Process/Add BPEL, and upload files
Note: If you have Deployed a service with the same service name, you must first enter main/Business Process/Deployed Packages to remove the previous service Undepoly.
3. Now, we can see a HelloServiceProcess in the Web Services/list
6. Manual wsdl2java
Because the Generate Client in BPS reports an error (you can select a bepl service if you do not believe it), you must manually Generate a java file.
The axis-1.6.1 package is required,
Http://axis.apache.org/axis2/java/core/download.cgi
If you have used the Client before, most of them have already been used.
Decompress the package and go to its bin directory.
Run the following command:
wsdl2java.bat -uri http://192.168.10.111:9766/services/HelloServiceProcess?wsdl -o ./temp -t
Uri is the address of wsdl1.1 of helloserviceprocess in your BPS. "-o./Temp" indicates to upload the generated code to the temp folder (create first)
After the creation is successful, you can copy two java files to the client project.
7. Use Client
Suppose our name is kongbuderunfeng. The running result is as follows:
8. Download source code
Helloserviceprocess BPEL project, which can be directly imported to eclipse. (The BPEL plug-in is required)
Http://115.com/file/e6p3ybm8#HelloServiceProcess_EclipseEE_Project.rar
Helloserviceprocesclient project, which can be directly imported to eclipse
Http://115.com/file/e6p3yo2b#HelloServiceProcessClient_EclipseEE_Project.rar
IX. Summary
BPS can be used to connect various services and define processes. The operation methods are similar.
Note the reference of namespace. another troublesome way to call other services is to use <bepl: Assign> for type conversion and assignment. In this step, it is best to have the program automatically generate