none
Testing a multiple input map with Visual Studio 2010 RRS feed

  • Question

  • hi ,

    i have an application where 

    1. first  receive the data , then cal to the service  get the response from service

    2. then call the sql procedure here i am getting data from 4 temp tables like 

    select * from  #a as a

    select * from  #b as b

    select * from  #c as c

    select * from  #d as d

    3.now i map received data and service resp and sql procedure resp to another service.

    every thing is working fine.

    But in case  if i dont get data from select * from  #a as a (remaining b,c,d are getting)

    in mapping nothing is mapped  even received data  and policy resp data  and some nodes of sql procedure are in available .

    Please help me.

    How can i debug map  with  multiple input.

    Thursday, September 8, 2016 10:34 AM

Answers

  • Hi Dinesh,

    - When you generate instance the namespace, the prefix will be added automatically.

    - When you paste the data manually from the schema instance, here also no need to extra work. Just past as is, the map will understand the message instance using target namespace.

    - Next like others told / in my previous link debug the map easily with breakpoints using XSLT.

    Generate Instance:

    // Generate Instance Input
    
    <ns0:Root xmlns:ns0="http://schemas.microsoft.com/BizTalk/2003/aggschema">
      <InputMessagePart_0>
        <ns1:Root xmlns:ns1="http://Filter.CRMSchema">
          <Record>
            <ID>Hello</ID>
          </Record>    
        </ns1:Root>
      </InputMessagePart_0>
      <InputMessagePart_1>
        <ns2:Root xmlns:ns2="http://Filter.IDOCSchema">
          <Record>
            <ID>Guys</ID>
          </Record>
        </ns2:Root>
      </InputMessagePart_1>
    </ns0:Root>

    Manual Data for Multipart map source:

    // Manually Copying Every schema Generate Instance
    
    <ns0:Root xmlns:ns0="http://schemas.microsoft.com/BizTalk/2003/aggschema">
      <InputMessagePart_0>
        <ns0:Root xmlns:ns0="http://Filter.CRMSchema">
          <Record>
            <ID>Hello</ID>
          </Record>
        </ns0:Root>
      </InputMessagePart_0>
      <InputMessagePart_1>
        <ns0:Root xmlns:ns0="http://Filter.IDOCSchema">
          <Record>
            <ID>Guys</ID>
          </Record>
        </ns0:Root>
      </InputMessagePart_1>
    </ns0:Root>

    Sample For Visualization

    Thanks, SMSVikasK


    Friday, September 9, 2016 4:47 AM
    Answerer

All replies

  • Hi Dinesh,

    if I don't get data from select * from a as a 

    - I didn't understand you here, can you clarify, are u getting empty response ? or any exception ?.

    - To get map execute successfully, you need to pass empty response structure as an input (for the above case).

    So that remaining data will be mapped, data sent out for the positive response you received.

    Debugging Map,

    That is same like normal map debug.

    - Test with generate instance

    - Open the souce input message

    - Replace all the generated input messages with test messages for Part 1,2,3.

    <ns0:Root xmlns:ns0="http://schemas.microsoft.com/BizTalk/2003/aggschema">
      <InputMessagePart_0>
        <!--Test Message A-->
      </InputMessagePart_0>
      <InputMessagePart_1>
        <!--Test Message B-->
      </InputMessagePart_1>
    </ns0:Root>

    - Right click and debug the map, with the help of XSLT.

    How to Debug Maps

    Debug that BizTalk Map

    Thanks, SMSVikasK



    Thursday, September 8, 2016 11:14 AM
    Answerer
  • Thanks arindam,

    But in second link ,explaind as 

    We have to create a map which is inverse of the above map. So it will have Single Source and Multiple Destination schemas. Now keep the TestMapInput property of the map to “GenerateInstance” and test the map. The output of the map is nothing but the required input xml format for the Multiple Source .

    incase if map is very complex and many condition. it is very difficult to recreate the entire Map from the scratch.

    so is there any other solution to select  multiple input. for testing/debugging map.

    Thanks.

    also  To get map execute successfully, you need to pass empty response structure as an input (for the above case)

    how can i achieve this.


    • Edited by DineshNad Thursday, September 8, 2016 12:28 PM
    Thursday, September 8, 2016 12:21 PM
  • That's fine Dinesh. Disregard that option.

    Did you get a chance to review the first link?

    You can create an input instance that conforms to the aggschema expected by the map. You will have as many <InputMessagePart_> elements as the number of input schemas to the map. You have to replace the content inside the <InputMessagePart_> elements with the actual input instance message for each of your 3 input schemas.

    <ns0:Root
    xmlns:ns0=http://schemas.microsoft.com/BizTalk/2003/aggschema>

    <InputMessagePart_0>

    //replace with input instance of first schema here, as shown below for second schema

    </InputMessagePart_0>

    <InputMessagePart_1>

    <ns2:SecondSchema
    xmlns:ns2=http://Didago.Samples.MultipleInputMap.SecondSchema>

    <LastName>LastName_0</LastName>

    <Country>Country_0</Country>

    <Age>10</Age>

    </ns2:SecondSchema>

    </InputMessagePart_1>

    <InputMessagePart_2>

    //replace with input instance of third schema here

    </InputMessagePart_2>

    </ns0:Root>


    Thanks Arindam



    Thursday, September 8, 2016 12:29 PM
    Moderator
  • Yes, Arindam,

    Not only replacing /replace with input instance of first schema here, as shown below for second schema

    also need to change  as below Bold content.

    -<ns0:Root xmlns:ns2="http://MapdebugApptest.source2" xmlns:ns1="http://MapdebugApptest.source1" xmlns:ns0="http://schemas.microsoft.com/BizTalk/2003/aggschema">

    -<InputMessagePart_0>

    -<ns1:Poldtls><nme>name_0</nme><addr1>addr2_0</addr1></ns1:Poldtls>

    </InputMessagePart_0>

    -<InputMessagePart_1>

    -<ns2:sr2><din>addr1_0</din></ns2:sr2>

    </InputMessagePart_1>

    </ns0:Root>

    so instead of taking risk

    first i created just one or two fields for each  source message part as explained(We have to create a map which is inverse of the above map)

    now we will get the proper format with one or two  fields. like below

    -<ns0:Root xmlns:ns2="http://MapdebugApptest.source2" xmlns:ns1="http://MapdebugApptest.source1" xmlns:ns0="http://schemas.microsoft.com/BizTalk/2003/aggschema">

    -<InputMessagePart_0>

    -<ns1:Poldtls><nme>name_0</nme><addr1>addr2_0</addr1></ns1:Poldtls>

    </InputMessagePart_0>

    -<InputMessagePart_1>

    -<ns2:sr2><din>addr1_0</din></ns2:sr2>

    </InputMessagePart_1>

    </ns0:Root>

     now we can replace remaining actual fields.it is easy like below 

    -<ns0:Root xmlns:ns2="http://MapdebugApptest.source2" xmlns:ns1="http://MapdebugApptest.source1" xmlns:ns0="http://schemas.microsoft.com/BizTalk/2003/aggschema">

    -<InputMessagePart_0>

    -<ns1:Poldtls>Replace with actual schema instace fields</ns1:Poldtls>

    </InputMessagePart_0>

    -<InputMessagePart_1>

    -<ns2:sr2><din>addr1_0</din></ns2:sr2>

    </InputMessagePart_1>

    </ns0:Root>

    now we can use this to test /debug

     a multiple input map with Visual Studio 2010

    thanks .


    • Edited by DineshNad Thursday, September 8, 2016 12:48 PM
    Thursday, September 8, 2016 12:46 PM
  • Hi,

    Debugging a map with multiple input shall consist of following steps.

    Right click on the map and commit to test map, make sure test map input is set to generate instance.

    This will give you an xml structure as input. Now you need to find the actual xml payload with the real data and replace the multi part node in the generated instance.

    Once done you have this xml request in the test map input in map properties Test Map Input Instance.


    Regards Pushpendra Singh : Please mark the reply as answer or vote it up, as deemed fit.

    Thursday, September 8, 2016 2:04 PM
  • Hi Dinesh,

    - When you generate instance the namespace, the prefix will be added automatically.

    - When you paste the data manually from the schema instance, here also no need to extra work. Just past as is, the map will understand the message instance using target namespace.

    - Next like others told / in my previous link debug the map easily with breakpoints using XSLT.

    Generate Instance:

    // Generate Instance Input
    
    <ns0:Root xmlns:ns0="http://schemas.microsoft.com/BizTalk/2003/aggschema">
      <InputMessagePart_0>
        <ns1:Root xmlns:ns1="http://Filter.CRMSchema">
          <Record>
            <ID>Hello</ID>
          </Record>    
        </ns1:Root>
      </InputMessagePart_0>
      <InputMessagePart_1>
        <ns2:Root xmlns:ns2="http://Filter.IDOCSchema">
          <Record>
            <ID>Guys</ID>
          </Record>
        </ns2:Root>
      </InputMessagePart_1>
    </ns0:Root>

    Manual Data for Multipart map source:

    // Manually Copying Every schema Generate Instance
    
    <ns0:Root xmlns:ns0="http://schemas.microsoft.com/BizTalk/2003/aggschema">
      <InputMessagePart_0>
        <ns0:Root xmlns:ns0="http://Filter.CRMSchema">
          <Record>
            <ID>Hello</ID>
          </Record>
        </ns0:Root>
      </InputMessagePart_0>
      <InputMessagePart_1>
        <ns0:Root xmlns:ns0="http://Filter.IDOCSchema">
          <Record>
            <ID>Guys</ID>
          </Record>
        </ns0:Root>
      </InputMessagePart_1>
    </ns0:Root>

    Sample For Visualization

    Thanks, SMSVikasK


    Friday, September 9, 2016 4:47 AM
    Answerer