Answered by:

receive filename

Question

i have a flatfile and i have to get the name of that flat file in the orchestration and should insert into the sqlserver with a new column into a table and i should send that file name to Biztalk and from there to client based on that file name
in an order how can i achieve this

Are you using the receivedfilename property to pickup similar messages in the same orchestration like correlating on file names? E.g. with parallel actions of with a singleton orchestration?
If this is the case, one orchestration will possibly handle both files and depending on the logic in it it could aggregate it. But personally I fon't think this is your case

ed hardy hoodies Is the output message name the same for both files (received file name property)?billig ed hardy If this is the case, the file
adapter is probably appending the data in the same file! You can then do the following:
1. In the properties of the file adapter on the OUT side, set the COPY MODE to "Create new". This will make a new file for each output.
2. You should make the file names unique by appending something to it (receivedFilename + timestamp for example).

All replies

I would suggest you to create a custom pipeline component to promote the file name to the context property of the incoming message and access the same context propery in your Orchestration using an expression shape.

You would be able to fetch the filename from the BTS.ReceivedFileName property as Greg mentioned. You have to construct the sql request message (generated from wizard) in the construct message shape. In the construct message shape you can load xml into
the System.Xml.XmlDocument variable like xmldocument.LoadXml("<SqlRequestschema><filename>" + filenamefromcontextproperty + "</SqlRequestschema></filename>"); and then assign the xml document to the sql request message.

Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'IFSAvante.BizTalk_Orchestration1(f0182be8-d8f2-2173-bf69-353cfc0b0b97)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 73ea4f80-fa90-44e6-bfd8-20953885db13
Shape name: ConstructMessage_1
ShapeId: 2525b19e-f65a-4c06-a0b9-7f8965ce0700
Exception thrown from: segment 1, progress 11
Inner exception: The 'FileName' start tag on line 1 does not match the end tag of 'VerifikatReq'. Line 1, position 54.

Exception type: XmlException
Source: System.Xml
Target Site: Void Throw(System.Exception)
The following is a stack trace that identifies the location where the exception occured

at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.Th

my project requirement is to send data to sql server and receive from there and send to client

when i drop two FF's in Csv format with same period like(01/04/2010) in both files i am getting only one xml file with combined records of both files but i should get two seperate xml files i have tried it using ReceivedFileName property
in orchestration i am using two orchestrations

there is one flatfile with different time periods like (01/01/2009)(01/09/2010)(01/11/2010)

so when i drop that flat file in INFolder it converts to xml and was send to out folder with
three xml files(ie when we set the polling interval in Recieve adapter of sql server)(based on polling interval
we get differnt Xml Files in output with a particular time period for each xml file)

((the project Requirement is When we drop two Flatfiles with same time period in both the files like(01/01/2009) in InFolder We should get two Xml files in OutFolder with same time period like(01/01/2009)
but we are getting only (ONE Xml FIle with combined records of Both the Files)))

the stored procedures for inserting into sql server and selecting and updating the stored procedure are

insertVerifikat.xsd and selectVerifikat.xsd

Actually i have schemas

FlatFile20.xsd(source)

FlatFileHeader.xsd

insertVerifikat.xsd(while inserting into sqlserver with a stored procedure Generated)

I think that both IN files are picked up by the same orchestration and then aggregated to one xml file on the OUT side?

Are you using the receivedfilename property to pickup similar messages in the same orchestration like correlating on file names? E.g. with parallel actions of with a singleton orchestration?
If this is the case, one orchestration will possibly handle both files and depending on the logic in it it could aggregate it. But personally I fon't think this is your case

Is the output message name the same for both files (received file name property)? If this is the case, the file adapter is probably appending the data in the same file! You can then do the following:
1. In the properties of the file adapter on the OUT side, set the COPY MODE to "Create new". This will make a new file for each output.
2. You should make the file names unique by appending something to it (receivedFilename + timestamp for example).

Are you using the receivedfilename property to pickup similar messages in the same orchestration like correlating on file names? E.g. with parallel actions of with a singleton orchestration?
If this is the case, one orchestration will possibly handle both files and depending on the logic in it it could aggregate it. But personally I fon't think this is your case

ed hardy hoodies Is the output message name the same for both files (received file name property)?billig ed hardy If this is the case, the file
adapter is probably appending the data in the same file! You can then do the following:
1. In the properties of the file adapter on the OUT side, set the COPY MODE to "Create new". This will make a new file for each output.
2. You should make the file names unique by appending something to it (receivedFilename + timestamp for example).