Parsing XML and Mapping issue

Home Page Forums BizTalk 2004 – BizTalk 2010 Parsing XML and Mapping issue

Viewing 1 reply thread
  • Author
    Posts
    • #21459

      Hi All,

                I am receiving an XML file from WebService of type below

       

      <?xml version=”1.0″ encoding=”utf-8″?>

      <ns0:System-results xmlns:ns0=”http://abc”&gt;

      <a>2345</a>

      <b>2345</b>

      <SequenceMessageHeader>

      <Seqnumber>100</Seqnumber>

      <TotalSequence>100</TotalSequence>

      </SequenceMessageHeader>

      <PO-tripped>9876000000000008374:PART NUMBER BBB:3000;9876000000000008374:PART NUMBER CCC:4000;</PO-tripped>

      <t-a>555</t-a>

      <Remarks>

      <OrderId>100</OrderId>

      <WebOrderId>100</WebOrderId>

      <Version>Version_0</Version>

      </Remarks>

      </ns0:System-results>

       

       

      As above XML message contains PO-tripped node which has 2 values(Could be  more than 2) separated with “semicolon”, I have to parse that  and have to get individual values, When I distinginguish that field “PO-tripped” and when I tried to get that in orchestration Mymessage.PO-tripped its giving an error saying PO Identigfier could not be found, So on some googling I came to know that XLang with will traet it as separate identifier, Then What I did was I  property promoted that field and trying to get that value. But Now my requirement is Once I get that Value I ahve to parse that  based on “;”

      9876000000000008374:PART NUMBER BBB:3000;

      9876000000000007374:PART NUMBER CCC:4000;

       And I have to create one more schema such as 

       

      <?xml version=”1.0″ encoding=”utf-8″?>

      <ns0:System-results xmlns:ns0=”http://abc”&gt;

      <a>2345</a>

      <b>2345</b>

      <SequenceMessageHeader>

      <Seqnumber>100</Seqnumber>

      <TotalSequence>100</TotalSequence>

      </SequenceMessageHeader>

      <PO>

      <tripped>9876000000000008374:PART NUMBER BBB:3000;;</tripped>

      <tripped>9876000000000008374:PART NUMBER CCC:4000</tripped>

      </PO>

      <t-a>555</t-a>

      <Remarks>

      <OrderId>100</OrderId>

      <WebOrderId>100</WebOrderId>

      <Version>Version_0</Version>

      </Remarks>

      </ns0:System-results>

       

       

      As I need indiviual PO-tripped values in separate node for that I have created schema above for that with change

       

      <PO>

      <tripped>9876000000000008374:PART NUMBER BBB:3000;;</tripped>

      <tripped>9876000000000008374:PART NUMBER CCC:4000</tripped>

      </PO>

      And one more thing 9876000000000008374:PART NUMBER BBB:3000;

      9876000000000007374:PART NUMBER CCC:4000;  

      these could be 0 or more

       

      I thought I will get PO-tripped  value using property promotion (since if I use Distinguished promotion And If I try to access  Like MyMsg.PO-tripped

      Its giving me error saying ” Cannot find PO identifier”, “Cannot find tripped Identifier”, Are u missing an assebly reference as PO-tripped is separated with ‘-‘ BizTalk treating it as separate identifier)  But now another issue I am facing is Property promoted valu should be max 256 char in length becoz of that Its giving error

       The value assigned to property ‘http:/abc’ is not valid: ‘9876000000000008374:PART NUMBER BBB:3000;9876000000000008374:PART NUMBER CCC:4000;’.Exception type: InvalidPropertyValueException.

      Now My question is::

      1) How Do  I Get PO-tripped  value from Xml for parsing.

      2) Incase If I parse that How Do Map those Parsed values to the new Schema Which I created for Assigning Parsed values to the child nodes

       

      <PO>

      <tripped>9876000000000008374:PART NUMBER BBB:3000;;</tripped>

      <tripped>9876000000000008374:PART NUMBER CCC:4000</tripped>

      </PO>

      Like This

       

      I will Greatly appreciated your  help……

       

       

       

      Thanks 

      Baba

       


       

       

       

    • #21488

      I got the Amswer….I got  PO-tripped value using Xpath such as xpath(Msg,”string(Xpath)”);

      Second Using .net component I formed <tripped>9876000000000008374:PART NUMBER BBB:3000;;</tripped>

      <tripped>9876000000000008374:PART NUMBER CCC:4000</tripped> these values.

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