Hello All,
Recently i had a requirement wherein I had to insert some records in siebel with input as XML Document and all this was to be done over REST web service.
There are 2 parts to this
Recently i had a requirement wherein I had to insert some records in siebel with input as XML Document and all this was to be done over REST web service.
There are 2 parts to this
- Inserting record from XML Document
- Expose the Business Service over REST (available only IP 16+)
Part 1, can be divided in further sub-parts
- Get XML Doc as Input and Convert XML Hierarchy to Siebel IO Hierarchy
Method: XMLDocToIntObjHier
Input: XML Documment (containg our target records, the type of Process property should be String)
- Pass the Hierarchy (output) from previous step as input in EAI Siebel Adapter
Method: Upsert
Input: Hierarchy (Output of previous step)
Part 2, to expose a BS as REST web service (inbound) follow the below steps
- Make entry for the Business Service in Administration - Application --> Business Service Access
- In the Access By Responsibilty section add the Responsibilty that needs to have access to this BS
Now you may think what different have we done in the above step, we created workflow as usual, so where is REST part??
Well siebel after IP 16, has a new architecture for REST, which can be explained as
1. Expose data using BO and BC Architecture (IO/IC)
http://ServerName:port/siebel-
Here the keyword /data/ specify the use of BO/BC architecture , i.e the above line translates to "search for Account Record with Id 88-4XVPD in Account BC and Account BO"
2. Expose data using Business Service Architecture
http://ServerName:port/siebel-
Here the keyword /service/ specify the use of Business Service architecture , i.e the above line translates to "Execute the QueryByExample of Business Service Siebel Account"
Note* this is just a high level detail , there are various other considerations like Methods (POST, GET, PUT) Headers, Body that need to be passed , will cover those in separate post
for a better understanding refer bookshelf https://docs.oracle.com/cd/
Since we have to expose the Process Over REST, lets try to do this.
1. Following the generic Siebel Rest Architecture for Exposing Business Service over REST, we will use the URL:
URL: https://hostname/siebel/v1.0/
Method: POST (BS uses post method to execute a action )
Body:
{
"body":
{
"XML":"<?xml version='1.0' encoding='UTF-16'?><
}
}
Here in "body", we have the input process property "XML" that will accept XML string as input. (this is standard input way to be used in REST URL calls)
*Sample output on postman tools for testing the BS
Now we have the Workflow ready, let us write a simple BS to accept XML document as input and expose it over REST.
Client BS to call workflow :
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /*var XML = "<?xml version='1.0' encoding='UTF-16'?><
var XML = Inputs.GetProperty('XML');
var sSvc = TheApplication().GetService(' var sInputs = TheApplication(). var sOutputs = TheApplication(). sInputs.SetProperty('XML Doc',XML); sInputs.SetProperty(' sSvc.InvokeMethod('RunProcess' Outputs.SetProperty('MSG'," return (CancelOperation); } |
<?xml version='1.0' encoding='UTF-16'?>
<SiebelMessage MessageId='1-1LYUKZH' MessageType='Integration Object' IntObjectName='Contact Integration Object' IntObjectFormat='Siebel Hierarchical' >
<
<Contact>
<Id>1-1122121</Id>
<FirstName>Sharma</FirstName>
<LastName>Sharma</LastName>
<EmailAddress>sharma@gmail.com
</Contact>
</
</SiebelMessage>