"Dynamic Send Port file" and "create folder" are not friend

Home Page Forums BizTalk 2004 – BizTalk 2010 "Dynamic Send Port file" and "create folder" are not friend

Viewing 1 reply thread
  • Author
    Posts
    • #21692

      Hello everybody,

       

      For my job I must create a send port file which create a folder (one per day) and put files into it.

      I’ve tricked the creation folder with .NET instruction in c# stocked in external library :

       

      [code]

              public static void CreateFolder(string activeDir, String SubDir)
              {
                  //Create a new subfolder under the current active folder
                  string newPath = System.IO.Path.Combine(activeDir, SubDir);

                  // Create the subfolder
                  System.IO.Directory.CreateDirectory(newPath);
                  [/code]

      For sending the file in the right folder I put a message assignement shape with these instructions :

      [code]

      Message_2 = Message_1;
      vDatetime = System.DateTime.Now.ToString(“yyyyMMdd-hhmmss”);
      External_Framework.CreateFolder(@”C:\Alten\test\testdynamicFolder\Out”,vDatetime);
      Message_2(FILE.ReceivedFileName)=”name.xml”;
      Port_2(Microsoft.XLANGs.BaseTypes.Address) = “file://C:\\”+vDatetime;

      [/code]

      When I execute this Application I’ve got this error :

      Error details: The FILE send adapter cannot open file C:\20090211-014355 for writing.
       Details: Access is denied.

      I’ve checked every Access Right : folder, grant, administration, BTS has all Right, I don’t know where is the problem

      May could you help me?

      Regards

    • #21695
      Something like :

      Port_2(Microsoft.XLANGs.BaseTypes.Address) = "file://C:\Alten\test\testdynamicFolder\Out
      "+vDatetime;

      ????
      • #21696

        I try it but it doesn’t worked too.

        In this case, the send port Create a file that contain the folder name

        • #21698

          I use this

          port_2(Microsoft.XLANGs.BaseTypes.Address)=@”FILE://” + DirPath + FileName;

          So in your case u might try :

          =@”FILE://C:\Alten\test\testdynamicFolder\Out”+vDatetime+”\name.xml”;

          or

          =@”FILE://C:\\Alten\\test\\testdynamicFolder\\Out”+vDatetime+”\\name.xml”;

           

           

          • #21711

            aaaaaah ok I see my error I don’t put the file name in the address field.

             

            Ok thank for your helps

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.