Home Page › Forums › BizTalk 2004 – BizTalk 2010 › "Dynamic Send Port file" and "create folder" are not friend
- This topic has 4 replies, 1 voice, and was last updated 9 years, 1 month ago by
community-content.
-
AuthorPosts
-
-
February 11, 2009 at 6:05 AM #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
-
February 11, 2009 at 6:52 AM #21695
Something like :
Port_2(Microsoft.XLANGs.BaseTypes.Address) = "file://C:\Alten\test\testdynamicFolder\Out
"+vDatetime;
????-
February 11, 2009 at 6:57 AM #21696
I try it but it doesn’t worked too.
In this case, the send port Create a file that contain the folder name
-
February 11, 2009 at 7:15 AM #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”;
-
February 12, 2009 at 1:24 AM #21711
aaaaaah ok I see my error I don’t put the file name in the address field.
Ok thank for your helps
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.