02-15-2022 07:14 AM
Is there a ability to upload a file into OnBase using Web Services Publishing [Unity Script]?Hyland.Unity.EnterpriseIntegrationServer.EISScriptEventArgs has InputMessageDocument to send the input XML/ JSON to the service unity script. In addition, can the unity script has the ability to read the byte stream from the request object?
Below is the sample client code in .net to invoke a REST WCF service to pass the file stream to be uploaded.
How can the unity script receive the File steam object to be uploaded into OnBase?byte[] bytearray=null ;string name = "";//throw new NotImplementedException();if (FileUpload1.HasFile){name = FileUpload1.FileName;Stream stream = FileUpload1.FileContent;stream.Seek(0, SeekOrigin.Begin);bytearray = new byte[stream.Length];int count = 0;while (count < stream.Length){bytearray[count++] = Convert.ToByte(stream.ReadByte());} }string baseAddress = "http://" + Environment.MachineName + ":8000/Service/FileUpload/";HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create(baseAddress+name);request.Method = "POST";request.ContentType = "text/plain";Stream serverStream = request.GetRequestStream();serverStream.Write(bytearray, 0, bytearray.Length);serverStream.Close();using ( HttpWebResponse response = request.GetResponse() as HttpWebResponse ){int statusCode =(int) response.StatusCode;StreamReader reader = new StreamReader( response.GetResponseStream() ); }
Appreciate your help!
Thank you!
Srimanth
02-18-2022 01:34 PM
Web Services Publishing can accept strings as input or base64. Input the same to the Unity Script and you can achieve it. We don't support byte stream.
You can also use HIS Workflow XML Messaging to use OffRamp to download the document to a temporary folder and create the document inside Onbase. Which will have less coding and more of a workflow logic.
Thank You,
Naveen
02-18-2022 01:34 PM
Web Services Publishing can accept strings as input or base64. Input the same to the Unity Script and you can achieve it. We don't support byte stream.
You can also use HIS Workflow XML Messaging to use OffRamp to download the document to a temporary folder and create the document inside Onbase. Which will have less coding and more of a workflow logic.
Thank You,
Naveen
03-01-2022 09:12 AM
Thanks Naveen for the response!
I think I can try to pass base64 string as input to the unity script, within the script, I can try to convert the base64 to byte stream, which can be used to create the document to be imported into OnBase.
With that I think we can avoid HIS Workflow XML Messaging. Can you please confirm?
03-01-2022 05:59 AM
03-01-2022 08:57 AM
The unity script is further making a communication with an external webservice to get the data, the obtained data needs to be further passed to the original OnBase web service client.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.