API ProtoProxy GetDocFile is not working after upgrading in 16.7

Hi Everyone.

We are using API to integrate our application to eB for retrieving document, uploading document, etc.

After upgrading to eB 16.7 the function for getting eB document seems not working , while it works perfectly in previous eB 15.6

We use protoproxy,GetDocFile, given the fileID is already retrieved in the prior process

The error shows that null reference is given.. (attached in pics below)

Is protoproxy,GetDocFile cannot be used anymore in eB 16.7 ? i know it is marked obsoleted but i thought it will still be working fine

Are there any advise on how to achieve same thing (getting the document) without using protoproxy ?

Below is my code :

[HttpGet]

        public FileStreamResult GeteBFile(Int32? FileId, String FileName)

        {

            if (session == null)

                ConnectToeB();

 

            if (FileId > 0)

            {

                Stream mStream = new MemoryStream();

                session.ProtoProxy.GetDocFile(session.Writer.SessionToken, FileId.Value, ref mStream);

                 mStream.Seek(0, SeekOrigin.Begin);

                return File(mStream, "application/force-download", FileName);

            }

            else

                return null;

        }