none
Biztalk General RRS feed

  • Question

  • I have a recieve location which receives the flat file and uses the flatfile disassembler  and it recieves the flat file like below

    201205297,CBO05000074,1999-05-31T13:20:00.000-05:00,1999-05-31T13:20:00.000-05:00,\

    now my requirement is what ever the file i have to store in a backup location.

    i used the send port and configured with .csv

    but the o/p is coming as

    can you help me where i am making the mistake in my orchestration?



    Thursday, July 3, 2014 6:04 AM

Answers

  • Am I correct in that you receive a flat file and want to save it exactly as it is to a backup location as well as process it through BizTalk?

    When receiving a flat file, if you have specified a flat file schema to use and also enabled the flat file disassembler pipeline on the receive location, you will get an XML document, just as you have noticed. The original file format is "lost". Biztalk has with the pipeline transformed the flat file into an XML document in order to be able to process it.

    Your options are basically two:

    One is to go the quick and dirty way of having an intermediate file transfer. Set up a file receive location that has a passthrough pipeline configured and that is coupled to a new receive port. This will make the flat file to untouched into BizTalk. Then set up two send ports that filter on this receive port and output with passthrough as well. One send port points to the backup location and one to a folder of your choosing. Then you use your current receive location and pull in the file that you just sent out from BizTalk. This will give you both the flat file as a backup as well as mapped to XML.

    The other (cleaner) solution is to to the backup archiving in the pipeline itself. This will keep the overall solution a lot cleaner and safer since you do not pipe files back and forth through ports. One of many examples on how to do this can be found here. In this case, you will retrieve the flat file, then before the pipeline parses the file into XML, it will stream it to a backup folder. This is what I recommend.

    Thursday, July 3, 2014 6:20 AM
  • Hi Sujith,

    If you requirement is to store the received file in a backup location, then you have two simple options. I don't know why you have used orchestration, if storing the file in a backup location is your requirement.

    Receive-Location (Use passthru pipeline) --> Send port (with Receive Port filter - i.e. BTS.ReceivePortName="YourReceivePortName" and use passthrugh pipeline in the send port again)

    If your have any business process to be applied while send the received message, then you can use orchestration (if necessary)


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Thursday, July 3, 2014 8:57 AM

All replies

  • There is no mistake in your orchestration. You're seeing the XML because from the receive port the disassembler would already have disassembled the message before it got published to the MessageBox. On being published is what triggered your orchestration.

    When sending the message you need to assemble it again FlatFileAssembler with the same schema.

    For your requirement I would suggest you look at the BizTalk Archive Pipeline component @http://biztalkarchiving.codeplex.com/ which will enable you to archive the message at the pipeline stage (before disassembly).

    Regards.


    • Edited by Shankycheil Thursday, July 3, 2014 6:19 AM PS
    Thursday, July 3, 2014 6:18 AM
  • For flat file ,you need to create send pipeline in application and configure created pipeline in send handler (in admin console send port).

    Biztalk functionality is ,everything should be xml,so the xml format has generated in your case ,to change the format you need to use send pipeline(which has created)

    Thursday, July 3, 2014 6:19 AM
  • Am I correct in that you receive a flat file and want to save it exactly as it is to a backup location as well as process it through BizTalk?

    When receiving a flat file, if you have specified a flat file schema to use and also enabled the flat file disassembler pipeline on the receive location, you will get an XML document, just as you have noticed. The original file format is "lost". Biztalk has with the pipeline transformed the flat file into an XML document in order to be able to process it.

    Your options are basically two:

    One is to go the quick and dirty way of having an intermediate file transfer. Set up a file receive location that has a passthrough pipeline configured and that is coupled to a new receive port. This will make the flat file to untouched into BizTalk. Then set up two send ports that filter on this receive port and output with passthrough as well. One send port points to the backup location and one to a folder of your choosing. Then you use your current receive location and pull in the file that you just sent out from BizTalk. This will give you both the flat file as a backup as well as mapped to XML.

    The other (cleaner) solution is to to the backup archiving in the pipeline itself. This will keep the overall solution a lot cleaner and safer since you do not pipe files back and forth through ports. One of many examples on how to do this can be found here. In this case, you will retrieve the flat file, then before the pipeline parses the file into XML, it will stream it to a backup folder. This is what I recommend.

    Thursday, July 3, 2014 6:20 AM
  • Hi Sujith,

    If you requirement is to store the received file in a backup location, then you have two simple options. I don't know why you have used orchestration, if storing the file in a backup location is your requirement.

    Receive-Location (Use passthru pipeline) --> Send port (with Receive Port filter - i.e. BTS.ReceivePortName="YourReceivePortName" and use passthrugh pipeline in the send port again)

    If your have any business process to be applied while send the received message, then you can use orchestration (if necessary)


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Thursday, July 3, 2014 8:57 AM
  • Before you try anything else, make sure you fully understand BizTalk Tracking.  It can store the received file for you.

    Thursday, July 3, 2014 11:52 AM
    Moderator