[solved]webservice - codeunit - instream parameter

massimopasqualimassimopasquali Member Posts: 82
edited 2016-11-08 in NAV Three Tier
Hello boys,

Is a possible to public a codeunit-web services that used a I stream parameter?
I have to send a stream from a service .NET C# to one webservice-codeunit NAV2013?

I have tried to do,but when I referred the codeunit with visual studio 2013, I received
An error on metada, if I delete a I stream parameter from the codeunit all work fine.

Can you help me?

Answers

  • crgarciacrgarcia Member Posts: 7
    You can think that a stream act as a pointer to a file.
    If you have a pointer to a file in your computer you cannot send it to a remote server, because it will not have access to your machine file.
    What you can do, is read all the data from a stream, and send that data to NAV.

    string allData = new StreamReader(dataStream).ReadToEnd();

    If your data is binary, then you will also have to convert it to Base64 to be able to transfer it.

    Regards,
    Carlos.
  • massimopasqualimassimopasquali Member Posts: 82
    thanks a lot
Sign In or Register to comment.