Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML to Flat File...

Status
Not open for further replies.

VCPro

Programmer
Feb 3, 2003
30
US
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!



 
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
 
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
 
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
 
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>
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top