How to turn the complex inbound SOAP Webservice for Oracle Siebel CRM IP2019 into REST service
20. 9. 2019
How to turn the complex inbound SOAP Webservice for Oracle Siebel CRM IP2019 into REST service
IP2016 introduced the REST framework for the webservices. Enterprises modernize its infrastructure and webservices and XML slowly belongs to the museums. We will show you how effectivelly reimplement the SOAP XML webservice into the REST services for more complex service.
For simple REST services we have added description in our blog .
In this blog we want to discuss some more complex services. Lets say we had SOAP Webservice to create Activity in the Siebel. This webservice is implemented in quite a complex Siebel workflow and the data were received via XML.
The implementation contains both external and internal integration objects, datamaps, xslt transformations etc. The goal is to expose this webservice to the other systems via REST protocol and not to reimplement all complex business logic. The XML contained external XML reflected in the external Integration Object, during the processing in the workflow was mapped to internal integration object and upserted to the Siebel database.
The Oracle Siebel CRM IP2019 introduced REST capabilities, but they do not yet map the known patterns such as convert json inputs into integration object hierarchy. Until Siebel IP19.5 we couldn't make it work. We decided to make generic approach and expose REST service and internally convert the json input into external integration object hierarchy, which is passed to the existing workflow. So for every existing inbound SOAP Webservice we just implment business service and wrapper workflow, which converts the json into input needed of existing implementation.
We want to present our approach to migrate transform the existing implementation of this service into REST.
1. Create new Business Service and create the needed method, lets say saveActivity.
2. Define any needed flat mandatory attributes under this method. The structure with the attributes for the activity, which is converted into integration object , put under parent such as parameters in the bellow example.
The JSON Input can look like this :
{
"body": {
"parameters":{
"saveActivity": {
"accountId":"",
"contractId":"",
"category": "Job",
"creationDate":"2019-07-30",
"creator":"SADMIN",
"creatorOrganization":"Default Organization",
"department":"",
"description":"TEST xlt",
"distributionChannel":"Fax",
"documentId":"",
"documentTitel":"",
"doneFlag":"",
"dueDate": "2019-11-15",
"finishUntilDate":"2019-11-15",
"language":"DE",
"limitMutationFlag":"true",
"noteCategory":"",
"partnerZipcode":"",
"plannedCompletion":"2019-11-15",
"plannedDate":"2019-11-15",
"priority":"1",
"processStatus":"1",
"range":"",
"rangeSub":"",
"role":"",
"sourceSystem":"SALAMANDER",
"status":"Open",
"subject":"REST Activity",
"textNumber":"",
"owner":"U803686",
"type":"25",
"parametersPerson": {
"personList":
[{"isPrimaryPerson": "false","personId": "10039063"},{"isPrimaryPerson": "true","personId": "10056388"}]
},
"parametersAtt": {
"attachmentList":
[{"fileName":"SprintDemoRestActionPDF1","fileExtension":"pdf","fileDate":"2014-12-08T00:00:00","fileSize":"90816","fileBuffer":"JVBERi0xLjUKJe}]
}
}
}
}
}
where parametersPerson is the MVG for contacts linked to the activity and parametersAtt is the attachment.
3. Script the calling of a wrapper workflow, which will prepare the input data for the processing in the original webservice workflow. Pass all inputs into wrapper workflow.
Let see example , where Inputs are from proxy REST BS :
function callWF(wfName, Inputs:PropertySet) {
var wfSvc:Service = TheApplication().GetService("Workflow Process Manager");
try {
Inputs.SetProperty("ProcessName", wfName);
wfSvc.InvokeMethod("RunProcess", Inputs, Outputs);
}
} finally {
wfSvc = null;
}
}
4. Implement wrapper workflow as follows :
10: JSONPSToXMLDoc is a XML Converter with method PropSetToXML which makes XML doc as input for later xslt transformation.
20: XSLT Transform. We transform the XMLDoc from json property set into external XMLDoc as sent with old SOAP webservice.
40: Transcode. This ensures it is UTF-8 encoded.
50: Transform XMLDoc 2 IO SM. This setp calls EAI XML Converter with method XMLDocToIntObjHier to have the desired external IO hierarchy for the legacy WS workflow , which creates activity.
70: call of the origin webservice workflow with the needed inputs.
Next steps parse the output and prepare them for the REST service response. The 60: operation steps routes the right worfklow based in method or operation.
5. Test your implementation for example with SOAP UI. Note that url for the service is POST https://yoursiebelhost/siebel/v1.0/BS/BSMethod/.
To get swagger you can youse GET https://yoursiebelhost/siebel/v1.0/BS/BSMethod/describe. The result may needs to be edited and corrected.
With this approach you can easily without risk re-implement everything expose existing SOAP Webservice as REST service. For more question don't hesitate to contact us.
Späť na Blog