×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

XML to Flat File...

XML to Flat File...

XML to Flat File...

(OP)
I have a source XML Document in which some of the elements repeat as below:  all part of same root element.

<elem1>
<elem2>
<elem3>
<elem4>
<elem5>
<elem3>
<elem4>
<elem5>
<elem6>

I have a destination schema for a Flat File in the format:
with the map as shown in the right.

Header - ELEM1 / ELEM2 / ELEM3
Detail - ELEM3 /ELEM4 / ELEM5
Trailer - ELEM6

I need an output in a flat file.  I am not using any Orchestration.  Using send port and receive ports.  Send port uses, a custom Send Pipeline with a FLatFile Assembler for the destination schema.  

We have multiple records for Elem3 - Elem4 - Elem5 values.  But, the output has only one record.  

Anyone seen this before?  Am I missing anything in the Map?
Do I need to include any Loopin functiods?

Would appreciate any help!


Thanks!



RE: XML to Flat File...

Hard to say, without seeing any of the Solution. But if you have more than one Element of
<elem1>
you will need to include a Looping functoid in your map.

Btw, you can test your map without deploying it to BizTalk.

If you right click your Map in your Visual Studio Solution Explorer and select Properties it opens a window where you can select a TestMap Input Instance.
Once that is done you select TestMap Input as Xml and TestMap Output as Native

Thats all you need to set up to test your Map. If you right click your Map again you can click Validate Map. This tells you if you have created a valid Map. If that succeeds click Test Map.

Easiest and fastest way to check if and how your map works!

HTH, Stephan
 

RE: XML to Flat File...

(OP)
All,

Stephan, Thanks for the Reply. I tried what you indicated but, no luck yet. so, I added Orchestration to the picture.

Objective:

I have an XML file and am trying to convert that into a Flat File in the Header/Detail/Trailer Format.

1. I created one source schema for the XML: generated using BizTalk GenerateSchemas... Option.
2. Created 3 different Schemas for destination: for Header, Body, and Trailer.
3. Created 3 different maps.
4. In the Orchestration, I am using Parallel Actions Shape and Added 3 Constructs, 3 Transforms within, and 3 Send shapes. All Send shapes send to the Same Send port so, we can Append data.

5. I am using XMLRecieve in the Receive Port Pipeline
6. I made a custom Pipeline for SendPipeline using Flat File assembler.

I am getting message: "Either the schema is not deployed correctly, or more than one schema is deployed for the same message type."

Anyone ran into this type of error before?
Anyone tried to Write XML to Flat files in this manner?
Any good website? or book?

Would appreciate any help!

Regards,
R

RE: XML to Flat File...

Hi, your error message actually says pretty good whats not working in BizTalk at the Moment!

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Either the schema is not deployed correctly, or more than one schema is deployed for the same message type
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

If you want to evaluate if your schema is deployed more than once, I suggest you install the Bts-Assembly Exlorer. This Explorer shows all your BTS Assembly and all of the Content inside the Assemblys (Schemas, Orchestrations, Pipelines,...)

How to install:

Navigate your Cmd to c:\Program Files\Microsoft BizTalk Server 2004\Developer Tools

Then do regsvr32 BtsAsmExt.dll

If you close all your Windows Explorer Windows and reopen them, you will find the new functionality inside your Windows Explorer.

Another possibility is that your Mappings dont work the way you want them to work and are producing different files. Can you just use a PassThrough Pipeline to just drop your Data into a file and try to validate that.  

See if that works.

Stephan

RE: XML to Flat File...

(OP)
Here is the sample XML


<?xml version="1.0" encoding="utf-16"?>

  <Material>
    
        <TagIdentifier>PS001</TagIdentifier>
        <Source>Database Tables</Source>
        <BatchNumber>222</BatchNumber>
        <CreationDate>04/05/05</CreationDate>
        <ProgramName>INteface Proof Of Concept</ProgramName>

        <TransferDate>04/07/05</TransferDate>
        <StockRoomVoucher>CheckVoucher</StockRoomVoucher>
        <FromCodiv>OneFromDiv</FromCodiv>
        <FromProject>TwoTestProject</FromProject>
        <FromPhaseActivity>ThreeActivity</FromPhaseActivity>
        <FromDept>FourTestDept</FromDept>
        <FromPool>FivePool</FromPool>
        <FromAccount>SixTestAccount</FromAccount>
        <ToCodiv>SevenDiv</ToCodiv>
        <ToProject>EightToProject</ToProject>
        <ToPhaseActivity>NineActivity</ToPhaseActivity>
        <ToDept>TenToDept</ToDept>
        <ToPool>Eleven2Pool</ToPool>
        <ToAccount>TwelveTestToAccount</ToAccount>
        <MaterialAmount>999</MaterialAmount>


        <RecordCount>TestCount</RecordCount>
        <ActivityDate>04/08/05</ActivityDate>
    </Material>

RE: XML to Flat File...

(OP)
Error Message:

There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive" Source: "XML disassembler" Receive Location: "C:\Labs\SourceFiles\Input\Interface.xml" Reason: The disassembler cannot retrieve the document specification by using this type: "Material". Either the schema is not deployed correctly, or more than one schema is deployed for the same message type.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close