90
Views
4
Comments
Solved
How to pass byte array to Outsystems from .NET Extension
Application Type
Reactive

Hi,

I need to pass byte array from C# code to outsystems, I'm not able to create a variable in outsystems that matches with byte array coming from the C#.


Thanks,

Bhuvan.

UserImage.jpg
Quentin P
Solution

Hi,

When you create a Binary Data output parameter within Integration Studio, it shows up in C# code as "out byte[] name". Best practice is probably to create the action within integration studio and then edit the C# function generated for you, rather than trying to map out the type with what you may expect.

As an example, see this simple action I created for adding page numbers to a PDF file. I edited only the lines between 30 and 52, and not the function signature (which was generated by Integration Studio).


2023-07-25 17-04-53
Mohit Sharma

Hi Bhuvan,

Can you please tell us what this byte array contains? I mean it is file, text, JOSN, Image?

2026-03-18 05-06-03
Bhuvan

private static IEnumerable XorOfRandom(string randomKeySender, string randomKeyReceiver)

        {

            var randomKeySenderBytes = GetByteFromBase64(randomKeySender).ToArray();

            var randomKeyReceiverBytes = GetByteFromBase64(randomKeyReceiver).ToArray();

            var sb = new byte[randomKeyReceiverBytes.Length];

            for (var i = 0; i < randomKeySenderBytes.Length; i++)

            {

                sb[i] = (byte) (randomKeySenderBytes[i] ^ randomKeyReceiverBytes[i % randomKeyReceiverBytes.Length]);

            }

        

            return sb;

        }

UserImage.jpg
Quentin P
Solution

Hi,

When you create a Binary Data output parameter within Integration Studio, it shows up in C# code as "out byte[] name". Best practice is probably to create the action within integration studio and then edit the C# function generated for you, rather than trying to map out the type with what you may expect.

As an example, see this simple action I created for adding page numbers to a PDF file. I edited only the lines between 30 and 52, and not the function signature (which was generated by Integration Studio).


2019-09-30 07-35-56
Aurelio Junior

Hello,

In OutSystems, you can use the "Binary Data" data type to handle byte arrays in C# extensions.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.