Steps:
- Log in to Siebel Tools and create a new custom business service.e.g: MyBS.
- Expand to Business Service Method and add a record:
Name = MyQuery - Expand to Business Service Method Arg and add 3 records:
- SiebelMessage, Type = Input, Data Type= Integration Object, Storage Type=Hierarchy , Integration Object = "EAI Account" (or your preferred IO)
- MyIO, Type = Output, Data Type= Integration Object, Storage Type = HIERARCHY, Integration Object = "EAI Account" (or your preferred IO)
- Error Message, Type = Output, Data Type = String, Storage Type = Property
Publishing Inbound Web Servicesfunction Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
if (MethodName == "MyQuery" )
{
// get hold of EAI Siebel Adapter BS
var adpBS = TheApplication().GetService("EAI Siebel Adapter");
// Variable to hold EAI Siebel Adapter output
var psQueryOutput = TheApplication().NewPropertySet();
// Variable to hold MyIO output argument.
var MyIOOutput = TheApplication().NewPropertySet();
// receiving an IO as input to the web service
// it gets passed to "Inputs" variable.
// passing "Inputs" directly to EAI Siebel Adapter.
adpBS.InvokeMethod("Query",Inputs,psQueryOutput);
// (Doc ID 476560.1)
MyIOOutput.SetType("MyIO");
// goes down the propertyset till you find the IO you are looking for.
// hint: Doc ID 477881.1
MyIOOutput.AddChild(psQueryOutput.GetChild(0).GetChild(0));
// set the output of your custom BS
Outputs.AddChild(MyIOOutput);
Outputs.SetProperty("Error Message","Record Retrieved Successfully");
// dump the output structure here
DumpPropSet(Outputs);
adpBS = null;
psQueryOutput = null;
MyIOOutput = null ;
return (CancelOperation);
}
else
{
return(ContinueOperation);
}
}
- 4. Right click the business service name and select Edit Server Scripts.
5. Choose eScript as the programming language.( could be Siebel VB too but the code sample below is eScript). Add the code below, review and compile to the server SRF.
6. Publish the business service as an inbound web service the usual way.
The steps are descriped in Bookshelf: Integration Platform Technologies: Siebel Enterprise Application Integration > Web Services > Invoking Siebel Web Services Using an External System >
Notice during the publishing process, the BS will NOT be listed. You have to add a new record and type in the BS name as documented in bookshelf.
7. Test. You may want to use a test utility such as SOAPUI or any other tool.
You may as well use use a siebel dedicated client and sample database as seen in How To Test Siebel Inbound Web Services Using a Siebel Client (Doc ID 473838.1).
If testing with a Siebel dedicated client, the following document may be helpful too: How To Create Integration Object Instances Programmatically (Doc ID 556846.1)
The DumpPropSet(Outputs) below helps us understand both how to pass data as output as well as data for input scenarios.
The important here is the structure should have 4 levels :
1) Inputs (or Outputs) property. It does not have any type set.
2) Business service method argument level property. This is a child of (1) above and has type = business service method argument name (in the example below "MyIO")
3) Integration Object representation. This is a child of (2) above and has type =ListOf<IO_NAME>
(in the example below ListOfEAI Account)
4) root integration component level. Should have type = root IC name.
In this case type = Account