K2 convert "File" data type to byte array for WS Call

  • 27 August 2015
  • 2 replies
  • 1 view

Badge

I have a "File" that i need to send via Web Service.

 

The Web Service recieves a byte array and i can't seem to find a way to convert a "File" type, which really is a XML string containing the name and content of the file, to a byte array.

 

Updating the Web Service is out of question, so the only other way is to create a DLL exposing a method that does this conversion....

There's no native K2 option for this?

 

Thank you in advance.


2 replies

Userlevel 1
Badge +8

Hi Nuno

 

I think you are correct in thinking you will need to write your own service broker to perform this conversion. There is no out of the box service to do this (that I am aware of).

Badge +10

Another thing to cnsder is that K2 encodes the file to base 64 so depending on the webservice you are calling you may have to decode it as well.

If you are calling the webservice from teh workflow (visual studio or k2 studio) then you can just insert a code envet to convert the file into byte array there. 

Reply