Forum Stats

  • 3,757,041 Users
  • 2,251,189 Discussions


Error in Downloading file from ucm to local directory using ridc

3698041 Member Posts: 7
edited Feb 8, 2019 9:55AM in WebCenter Content

Hi Experts,

I am using RIDC to download the files from content server below is my code given :


                  IdcClientManager manager = new IdcClientManager ();





                                        IdcClient idcClient = manager.createClient ("idc://");


                     IdcContext userContext = new IdcContext ("oudadmin");


                     HdaBinderSerializer serializer = new HdaBinderSerializer ("UTF-8", idcClient.getDataFactory ());



                     DataBinder dataBinder = idcClient.createBinder();

                   System.out.println("inside dataBinder and above GET_FILE");

                    dataBinder.putLocal("IdcService", "GET_FILE");


                    System.out.println("after GET_FILE");

                    dataBinder.putLocal("dID","1804" );


                    System.out.println("after did and ddocname");

                   //  dataBinder.putLocal("dDocName", "MYDOCNAME");

                    dataBinder.putLocal("allowInterrupt", "1");

                     serializer.serializeBinder(System.out, dataBinder);

                    FileOutputStream fos = new FileOutputStream("test.txt");

                       ServiceResponse response1 =

                       idcClient.sendRequest(userContext, dataBinder);


                       InputStream fis = response1.getResponseStream();

                       ByteArrayOutputStream bos = null;

                    System.out.println("after bytearrayoutputstream assis");


                       byte[] readData = new byte[1024];

                       int i =;

                       while (i != -1) {

                         fos.write(readData, 0, i);

                         i =;


                           System.out.println("after bos.write");

                           // Close the socket connection


                              // Don't leave the streams open









I   am calling this code from jsp page although the code is running successfully without any error but document is not getting download to the local system.

I don't why its not functioning as expected.




  • ManojC
    ManojC Member Posts: 538
    edited Feb 7, 2019 9:40AM

    Can you try to run the code from your local IDE to make sure the document streaming is working fine. Also if you are passing the dID value as input then you don't have to pass dDocName as part of the binder. I can see you have modified the default idcclient port to 4448, so check you have the socket connection is working from your client to server.

  • 3698041
    3698041 Member Posts: 7
    edited Feb 7, 2019 9:58AM

    Hi ManojC,

    Thanks for the reply, the idc port is correct as the checkin part from ridc has been done from this port. aslo the document streaming is working fine.


  • ManojC
    ManojC Member Posts: 538
    edited Feb 8, 2019 9:55AM

    You need to enable some tracing in CS and monitor the activity. Also in the response object check the header values like (Content-Type, Content-Length) to see the file is part of the response or not.

    I don't see any other reason on why its failing to download the document after establishing the connection.