Tallan's Technology Blog

Tallan's Top Technologists Share Their Thoughts on Today's Technology Challenges

Testing Multi-part Map

Yuriy

Recently I was debugging an orchestration and found unexpected output from the map. The obvious decision was to use Visual Studio’s “Test Map” option. I opened the Map and realized that “Input” schema is a multi-part schema.

Combining two xml messages into one file will produce the multiple roots exception. So, I looked at the map’s source to figure out the structure. In order to view the map source, I simply ran “Validate map” and opened the generated xslt stylesheet.

The interesting part I found on the top of the schema was:

<?xml version=”1.0″ encoding=”UTF-16″?>
<xsl:stylesheet xmlns:xsl=”http://www.w3.org/1999/XSL/Transform
xmlns:msxsl=”urn:schemas-microsoft-com:xslt”
xmlns:var=”http://schemas.microsoft.com/BizTalk/2003/var
exclude-result-prefixes=”msxsl var s1 s0 userCSharp”
version=”1.0″

The aggregation schema
xmlns:s1=http://schemas.microsoft.com/BizTalk/2003/aggschema

Here is the root
<xsl:apply-templates select=”/s1:Root” />
</xsl:template>

The  catch statement
<xsl:template match=”/s1:Root”>
<ns0:CreateNewTaskRequest>
<xsl:for-each select=”InputMessagePart_1/ns0:WorkflowTaskList…”>

The Input message has to have the following structure in order to comply with the generated schema:

<ns0:Root xmlns:ns0=”http://schemas.microsoft.com/BizTalk/2003/aggschema>
<InputMessagePart_0>
Message 1
</InputMessagePart_0>
<InputMessagePart_1>
Message 2
</InputMessagePart_1>
</ns0:Root>

Here is the resulting message I came up with for testing.

<ns0:Root xmlns:ns0=”http://schemas.microsoft.com/BizTalk/2003/aggschema>
<InputMessagePart_0>
<ns0:IssueProcessRequest xmlns:ns0=http://Workflow.IssueProcessing.IssueProcessRequest>
<IssueId xmlns=””>16</IssueId>
<IssueTypeId xmlns=””>1</IssueTypeId>
<IssueTypeCode xmlns=””>REQUEST</IssueTypeCode>
<IssuePurposeId xmlns=””>2</IssuePurposeId>
<WorkflowTaskId xmlns=””>0</WorkflowTaskId>
<IssueStatusCode xmlns=””>O</IssueStatusCode>
<IsApprovalNeeded xmlns=””>false</IsApprovalNeeded>
<SpecialInstraction xmlns=”” />
</ns0:IssueProcessRequest>
</InputMessagePart_0>
<InputMessagePart_1>
<ns0:WorkflowTaskList nodeid=”1″ xmlns:ns0=”Oakleaf.Workflow.IssueProcessing”>
<WorkflowTask id=”1″ WorkflowTaskTypeCode=”I”    Resolution1=”SVS_SCHD”
Resolution2=”” xmlns=”Oakleaf.Workflow.IssueProcessing”      workflowTaskAssignedToUserTeam=”CS_SVC_CONFIRM” />
</ns0:WorkflowTaskList>
</InputMessagePart_1>
</ns0:Root>

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

\\\