Sanjeev Kumar Paul

Hi All,

I have created a dynamic send port in BTS to drop the mail attachement.BTS is picking the file but while droping its showing error.

A message sent to adapter "FILE" on send port "ReceiveMail_1.0.0.0_ReceiveMail.MailAccess_SendPort_af83109a15265860" with URI "file://C:\TestingFiles\" is suspended.

Error details: The FILE send adapter cannot open file C:\TestingFiles\ for writing.

Details: The system cannot find the path specified.

I have written the following code for this.

strFilePath = @"C:\TestingFiles\";

System.IO.Directory.CreateDirectory(strFilePath);

SendPort(Microsoft.XLANGs.BaseTypes.Address) = "file://" + strFilePath ;

Can anyone please help me in solving this error.



Re: BizTalk R2 General Dynamic Port Error

Nicolae Daian - MSFT

You should make sure the host user has the proper rights in that folder.

[Please mark the response as "Answer" if it solves your problem.]




Re: BizTalk R2 General Dynamic Port Error

ibrahim durmus - Microsoft Corp

Hi Sanjeev,

Can you take your Directory Creation logic out of orchestration. I guess, there can be either a timing issue or a directory security issue. Can you take a look at the properties of you folder in file system

One More Note: AFAIK, there should be another overload of CreateDirectory which lets you give security context. You can also try that one out.

Thanks,

- Ibrahim DURMUS
http://www.ibrahimdurmus.com
http://blogs.msdn.com/ibrahim






Re: BizTalk R2 General Dynamic Port Error

Kent Weare

DId the Folder get created Also, I don't see where you are providing the name the file ie:

SendPort(Microsoft.XLANGs.BaseTypes.Address) = "file://" + strFilePath + "file_name.txt";





Re: BizTalk R2 General Dynamic Port Error

ibrahim durmus - Microsoft Corp

Yep. Kent is true. You should append the filename at the end

- Ibrahim DURMUS
http://www.ibrahimdurmus.com
http://blogs.msdn.com/ibrahim






Re: BizTalk R2 General Dynamic Port Error

Sanjeev Kumar Paul

Hi Kent,

BTS is creating the folder but its not droping the file.I have appended the file name also.

SendPort(Microsoft.XLANGs.BaseTypes.Address) = "file://" + strFilePath + MessageIn(File.ReceivedFileName);

Then also i am getting the same error :-

The FILE send adapter cannot open file C:\TestingFiles\ for writing.
Details: The system cannot find the path specified.

Please give me some idea regarding this.

Thanx in Advance.





Re: BizTalk R2 General Dynamic Port Error

Kent Weare

MessageIn(File.ReceivedFileName); will proivde the entire path of where the file originated won't it Did you restart your host instance after you made that code change

THe other thing that I would suggest(as did Nicolae) is make sure that the host instance user has the correct privaleges to write to that folder.





Re: BizTalk R2 General Dynamic Port Error

Sanjeev Kumar Paul

Thanks a lot for replying....

Good news for you..I have solved the problem now its working fine...

I have written the following code...

strFilePath = "C:\\TestingFiles\\";

System.IO.Directory.CreateDirectory(strFilePath);

SendPort(Microsoft.XLANGs.BaseTypes.Address) = "file://" + strFilePath + "%SourceFileName%";

Thanx again....