Steps for creating Webservice in SI
1.Create BP for what actual function works (ex: addition or Translation )
2.create Webservice using that above BP.
3.Download WSDL file.
4.Deploy this WSDL file into Consumer/client system.
5.After Deploying WSDL into Client System its create Dynamic Service in GPML.
6.We can create BP using the Dynamic Service.
7.We can run this BP using input document.
Scenario:
Addition of two numbers
Step1:
I am creating BP with a function sum (addition of two numbers) .
Creating BP : Sum.bp
<process name="sum2">
<sequence>
<assign to="doc" from="DocToDOM(PrimaryDocument)"></assign>
<assign name="Assign" to="sum" from="number(//param1/text())+number(//param2/text())"></assign>
</sequence>
</process>
Note:
Here I am taking input as a Primary Document from “ Input.BP “.
Now Creating Webservice:
Goto>Deployment>Manager>
Create BP with Uniq name
Note: Certificates are not optional
click next-next
in Assign Business Processes service we have to select the BP (Sum.bp)
Note: select BP Non-Queued mode when using Boostrap a BP.
Reliable setting:
Autodetact---Don't allow Duplicates
Reliable only—Allow Duplicates
NonReliable –Both are accepted
WS-I Basic profile 1.1 Conformance Settings –optional or select
| Make the generated WSDL conform to WS-I Basic Profile 1.1 |
Attachement: optional
Input
output
inline
Click next ..finished.
Download WSDL from Webservice.
Step3: producer can share this WSDL to Consumer
Consumer can chek into his server example..130
after checking into WSDL file it creates Dynamic service in GPML.
Here executesum2 is the Dynamic service.
Using dynamic service we create BP as...
Input.bp:
<process name="output">
<sequence>
<assign to="sum2" from="//PrimaryDocument/@*"></assign>
<operation name="executesum2">
<participant name="DS_SUM2_PORT1_OPE1_Instance"/>
<output message="DS_SUM2_PORT1_OPE1InputMessage">
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
</sequence>
</process>
we give input as follows.
<?xml version = "1.0" encoding = "utf-8"?> <mesa:sum2 xmlns:mesa="http://www.sterlingcommerce.com/mesa"> <data> <param1>3</param1> <param2>4</param2> </data> </mesa:sum2>
this is the structure of input file .
Now I am executing BP with this input file .
Procedure of the web service calls:
We have to execute Input.bp with the input file it's taking the input file as a primary document then it proceed with dynamic service it calls sum.bp . It execute the BP and gives a result of the Input.
Comments
Post a Comment