send/receive xml message question

Home Page Forums BizTalk 2004 – BizTalk 2010 send/receive xml message question

Viewing 3 reply threads
  • Author
    Posts
    • #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??
    • #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

    • #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&#8221; xmlns:b=”http://schemas.microsoft.com/BizTalk/2003&#8243; elementFormDefault=”qualified” targetNamespace=”http://ArielBPM.Biztalk.RequestManagement.Schemas&#8221; xmlns:xs=”http://www.w3.org/2001/XMLSchema”&gt;

        <xs:annotation>

          <xs:appinfo>

            <schemaInfo is_envelope=”yes” root_reference=”QueueUpAndNotifyRequests” xmlns=”http://schemas.microsoft.com/BizTalk/2003&#8243; />

          </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&#8221; xmlns=”http://schemas.microsoft.com/BizTalk/2003&#8243; />

            </xs:appinfo>

          </xs:annotation>

        </xs:element>

        <xs:complexType name=”QueueUpAndNotifyRequests”>

          <xs:sequence>

            <xs:any />

          </xs:sequence>

        </xs:complexType>

      </xs:schema>

       

      • #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?

        • #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.

    • #22573

      I will try it out!

Viewing 3 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.