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
03-01-2022 11:05 AM
Hi Srimanth, Yes you can do that.
03-01-2022 11:08 AM
Thank you!
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.