Home Page › Forums › BizTalk 2004 – BizTalk 2010 › source file name in the body of an email
- This topic has 8 replies, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
December 4, 2006 at 11:17 AM #16699
Hi,
I have a Send Port of type SMTP and body of the message is below. I have selected ‘Email body’ as “Text” type in SMTP Transport properties -> Compose Tab. In the email body, I want BizTalk to put file name some thing like \\server2\BizTalk\Suspended\test12222.txt .
But, in this message BizTalk is not replacing %SourceFileName% with actual file name. Pls let me know how to put actual source file name in the body of an email.
Dear Admin,
There was an error found while processing the agile file. This file can be found at \\server2\BizTalk\Suspended\%SourceFileName% and for error details, please check event log.
Thanks.
-
December 4, 2006 at 9:00 PM #16715
You’d need to build the string as your want it inside the Orchestration. And then set that to the message body.
The properties you’d want to look at are File.ReceivedFileName (or http://FTP.ReceivedFileName , etc)or BTS.InboudTransportLocation. You might need to combine this together to get what you want.
Hope this helps.
-
December 6, 2006 at 10:31 AM #16748
Thanks for your reply.
I am not using any orchestration in this case, just using messaging (Receive Port -> Map -> Send Port) only. I need to use %SourceFileName% (or equivalent) in email body property of sendport of type SMTP.
Thanks.
-Gopi
-
December 6, 2006 at 2:37 PM #16754
Oh, the solution is a little harder. You’ll have to do what I described inside a custom pipeline and set the email body inside the pipeline.
It would be easier to do inside an Orchestration and that would be the right place for this type of logic, in my opinion.
-
December 13, 2006 at 11:12 PM #16893
Hi,
i read your description abt %SourceFileName%. i tried the following in the Expression Editor using Message Assignment in Orchestration. I have a query:
I have created a send message "Testver7SendMsgInc"
and receive message named "Testver7RecMsgInc"When i type the following code in the Expression Editor
Testver7SendMsgInc = Testver7RecMsgInc;i get the following error:
Cannot implicitly convert type 'message Testver7Schemas.XMLInputFile1' to 'message Testver7Schemas.FlatFileSchema1'And below it when i type:
Testver7SendMsgInc(FILE.ReceivedFileName) = System.Convert.ToString(Testver7RecMsgInc.ACTSEQ);I get the following error:
identifier 'ACTSEQ' does not exist in Testver7RecMsgInc'; are you missing an assembly reference?ACTSEQ is my child field element.
Well one thing i would to tell you is that my input schema ie XMLInputFile1 and output schema ie FlatFileschema1 and and map are in one project while orchestration which has both Testver7SendMsgInc and Testver7RecMsgInc in another project in the same solution. I have referenced my schema project in the orchestration project.
Pls tell me what is the problem. and solution.
Basically i want to get the value of ACTSEQ ie is a child field element, which i am getting from an XML file, to be shown as a name in my output file ie is a .txt file.Thanks, waiting for ur reply.
My email id : [email protected]
Gaurav Garg-
December 16, 2006 at 7:06 PM #16962
Well, your two message schema need to be the same to create a new message from it. It looks like you have two different schema. If that’s the case, you’ll need a map.
-
December 18, 2006 at 4:07 AM #16984
Hi Stephen,
Thanks for replying.
Yes i have used two different schemas. The input schema ie XMLInputFile1 is an XML schema. while output schema is a Flat File schema. And i have used map to connect them.
I have a child field element named "ACTSEQ" in the XMLInputFile1, who's value i want to show as an output file name. My input file is an XML file while output file is a .txt file
Please tell me how can i do that?
Thanks in advance
Gaurav Garg
-
December 18, 2006 at 6:50 AM #16987
Oh, if that’s what you are trying to do. I’d do an XPath into the message and get the value. Then set it to the File.ReceivedFileName property. Then, use the %SourceFileName% Macro on the send port.
I have samples (under BizTalk 2004 I think) of using XPath and Setting the File Name.
Best of luck.
-
December 19, 2006 at 11:08 PM #17015
Hi,
Thanks for replying.
I tried your solution to use XPath.
In the "Message Assignment Expression Editor" is wrote:
Testver7SendMsgInc = xpath(Testver7RecMsgInc,"/*[local-name()='ContainerPro1' and namespace-uri()='']/*[local-name()='ACTSEQ' and namespace-uri()='']");
ContainerPro1 is my incoming schema ie XMLInputFile1 Root name.
ACTSEQ is a child field element node, whose value i need to show as an output file name.
I am using custom SendPipeline with Flat File assembler. and %SourceFileName%.txt in the sendport file name configuration, but I get the following error:
There was a failure executing the send pipeline: "Testver7Schemas.SendPipeline1, Testver7Schemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=95070596c425719e" Source: "Flat file assembler" Send Port: "Testver7SendPort" URI: "F:\Biztalk\BizTalk\ProjectExperiment\Testver7OwnSolution\Target\%SourceFileName%.txt" Reason: This Assembler cannot retrieve a document specification using this type: "ACTSEQ".
This error is not due to multiple assemblies, as it run perfectly if i remove Message Assignment.
I haven't specified Target Namespace, if i specify it, i again get some other errors with receive pipeline. I tried to use different pipelines too, but of no use.
But when i use PassthruPipeline i get the output but file name as %SourceFileName%.txt, and file output text is also wrong, which i don't want.
Please could you guide me where is the error, and what is the solution in details , as i am new to Biztalk so finding it difficult to get the result.
Is there any solution that i can get the file name same as my input file name. Example i have an input file name say: "input_234.xml" , so can i get the same file name as my output file name like "input_234.txt" . if i can do this it would be fine.
Thanks once again. Hope to get a positive and quick response from your side.
Gaurav Garg
-
-
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.