base64 encoding for Siebel Outbound WebService
(Doc ID 490895.1)
Last updated on NOVEMBER 22, 2019
Applies to:
Siebel CRM - Version 7.7.2 [18325] and laterGeneric Windows
Currency review on 27/03/207
Symptoms
The requirement is to write a Business Service in eScript, which reads a file and calls a Outbound Web Service.
The file itself is transferred by the Web Service using a byte array.
After importing the WDSL using the EAI Wizard, the byte array gets mapped to a string.
Therefore the file data must be base64 encoded and the resulting string used as a parameter for the Web Service.
var Inp = TheApplication().NewPropertySet();
Inp.SetProperty("FileName", inTempFileName);
Inp.SetProperty("FileText", "false"); // don't open as text
Inp.SetProperty("IsReceivingTextData", "false");
var fileTransport = TheApplication().GetService("EAI File Transport");
var filePropSet = TheApplication().NewPropertySet();
fileTransport.InvokeMethod("Receive", Inp, filePropSet);
// the following line fails, because of value is binary
var dataString = filePropSet.GetValue();
// missing: conversion of binary data in filePropSet into base64-encoded String
// put the base64 encoded file-data as a string into the propertySet
wsInput.SetProperty("WriteDocumentSoapIn:data", dataString);
// call Web Service
IXOS_LAPISBLDocService.InvokeMethod("WriteDocument", wsInput, wsOutput);
====================================
tried the following:
var psXMLOutputs = TheApplication().NewPropertySet();
xmlConverter.InvokeMethod("PropSetToXML", filePropSet, psXMLOutputs);
var dataString = psXMLOutputs.GetValue();
xmlConverter.InvokeMethod("PropSetToXML", filePropSet, psXMLOutputs);
var dataString = psXMLOutputs.GetValue();
The result is not what is expected, because the value of the property set is embedded in other xml-tags.
Changes
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |