Objective
This document helps us to create a sample Inbound web service which uses a Business Service. An outbound Web service is created and a workflow is used to call the Inbound that we had created, thereby helping us learn how to create an Inbound and an Outbound Web Services in Siebel.
Creating an inbound
1. Create a Business Service with the following details. You can use the attached XML and import the business Service into your Siebel Tools instead.



Add the following code in the PreInvokeMethod of the Business Service.
function Service_PreInvokeMethod(MethodName,Inputs,Outputs)
{
var z;
switch(MethodName)
{
case 'Add':
z= ToNumber(Inputs.GetProperty("a") )+ToNumber( Inputs.GetProperty("b"));
Outputs.SetProperty("sum",z);
return(CancelOperation);
break;
}
return(CancelOperation);
}
2. Compile the business service to your local srf and move it to server.
3. Create an inbound web service and select the Business Service you’ve created.



4. Click on Generate WSDL and save the WSDL file. Here is the WSDL generated by the above eg.

Outbound Web Service
5. Open Siebel Tools (connecting to sample) and import the WSDL.
File -> New Object -> EAI -> Web service

Select the WSDL file.


This will create a proxy business service and a runtime configuration data file. Compile the BS onto the sample.

6. Import the runtime configuration data file in the outbound web services screen of the sample.
Here in this case WSDLexp.xml


7. Create a workflow in sample to call the inbound Web service thru the Proxy BS that we imported in step 5. You can also import the following workflow instead of manually creating the Workflow.

Here are the steps to create the workflow.

8. Right click and select Edit workflow process, create a workflow as shown below and create a new process property called Sum Value

9. Select the Proxy Business service Name and the method.

10. Right click the business service and click on show input arguments. Add the following details

11. Right click the Business service and click on show output arguments. Add the following details.

12. Set the debug settings in view -> options -> debug. Right click and simulate the workflow. Look at the watch window -> sum value Process property for the output.

No comments:
Post a Comment