Home Page › Forums › BizTalk 2004 – BizTalk 2010 › send/receive xml message question
- This topic has 5 replies, 1 voice, and was last updated 9 years, 1 month ago by
community-content.
-
AuthorPosts
-
-
June 2, 2009 at 6:45 AM #22555
Hi!
I’m trying to send/receive with visual studio and I have done all necessary things like set up inpipeline(I used the xml disassembler),outpipeline, orchestration, mapping, assembly key etc and created inport/outport and connected it with orchestration in biztalk server 2006 admin….
Well my problem is when I move the xml file to the “IN” folder it disappears and moves to “OUT” folder which is good but the mapping isn’t great 🙁
Then I tried again with a modified xml file
<Item>
<ProductName>Iron Maiden</ProductName>
<ProductPrice>99</ProductPrice>
<ProductNumber>1</ProductNumber>
<ProductCount>6</ProductCount>
</Item>that worked!
But WHY doesn’t this work:
<?xml version=”1.0″ encoding=”utf-8″ ?>
<ArrayOfItem xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance“ xmlns:xsd=”http://www.w3.org/2001/XMLSchema“><Item xsi:type=”CD“><ProductName>Iron Maiden</ProductName><ProductPrice>99</ProductPrice><ProductNumber>1</ProductNumber><ProductCount>6</ProductCount></Item></ArrayOfItem>Any suggestions?? -
June 2, 2009 at 8:46 AM #22557
You schema is like your contract, meaning that your orchestration will only take the xml that conforms to the schema. In your case, the orchestration expects the message of type Item, not ArrayOfItem
-
June 2, 2009 at 12:05 PM #22561
You can create an Envelop Schema call <ArrayOfItem>, then the receive pipeline will split the ArrayOfItem in into multiple <Item>.
Here is an example of envelop schema:
<?xml version=”1.0″ encoding=”utf-16″?>
<xs:schema xmlns:tns=”http://ArielBPM.Biztalk.RequestManagement.Schemas” xmlns:b=”http://schemas.microsoft.com/BizTalk/2003″ elementFormDefault=”qualified” targetNamespace=”http://ArielBPM.Biztalk.RequestManagement.Schemas” xmlns:xs=”http://www.w3.org/2001/XMLSchema”>
<xs:annotation>
<xs:appinfo>
<schemaInfo is_envelope=”yes” root_reference=”QueueUpAndNotifyRequests” xmlns=”http://schemas.microsoft.com/BizTalk/2003″ />
</xs:appinfo>
</xs:annotation>
<xs:element name=”QueueUpAndNotifyRequests” type=”tns:QueueUpAndNotifyRequests”>
<xs:annotation>
<xs:appinfo>
<recordInfo body_xpath=”/*[local-name()=’QueueUpAndNotifyRequests’ and namespace-uri()=’http://ArielBPM.Biztalk.RequestManagement.Schemas’%5D” xmlns=”http://schemas.microsoft.com/BizTalk/2003″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:complexType name=”QueueUpAndNotifyRequests”>
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:schema>
-
June 7, 2009 at 1:58 AM #22600
But how about mapping:
<?xml version=”1.0″ encoding=”utf-8″?>
<ArrayOfItem xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema“>
<Item xsi:type=”CD”>
<ProductName>Iron Maiden</ProductName>
<ProductPrice>99</ProductPrice>
<ProductNumber>1</ProductNumber>
<ProductCount>6</ProductCount>
</Item>
</ArrayOfItem>to:
<?xml version=”1.0″ ?>
<Inventory>
<Item>
<Name>South of Heaven</Name>
<Count>666</Count>
<Price>66,6</Price>
<Comment>Varldens basta skiva</Comment>
<Artist>Slayer</Artist>
<Publisher>Def Jam</Publisher>
<Genre>Metal</Genre>
<Year>1986</Year>
<ProductID>666</ProductID>
</Item>
</Inventory>Is it still necessary with an envelope schema?
-
June 7, 2009 at 7:52 PM #22605
It depends on how you define your <Inventory> schema. If the number of occurrence of <Item> is more than 1, then you don’t have to create the envelope schema. You can just need to use a looping functoid to do the mapping.
-
-
-
June 3, 2009 at 10:55 AM #22573
I will try it out!
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.