Passing Name Value Pair to the Biztalk Orchestration

The Biztalk Messaging accepts the XML, Custom XML and name value pair inputs. Document specifications describe the internal structure of your document instances. Biztalk Messaging validates the input files with the specification. User can create the specification for XML using the Biztalk editor, but for name value pair needs to create custom specification.

Create Specification

This is the procedure for creating the specification for the name value pair.

Open the Biztalk Editor and do the following steps

  1. On the File menu, click New.
  2. The New Document Specification dialog box appears.
  3. Click Blank Specification and click OK.
  4. Select Declaration in the right pane and change the name as it meaning full main node (for our request change “Blank Specification” as “Request”)
  5. Select the Reference tab and Double-click the Value field in the Standard row.
  6. In the Standard list, click CUSTOM and press ENTER.
  7. Click Yes to confirm the change.
  8. Change the Default Record Delimiter value to & (0x26).
  9. Next, select the Parse tab on the right pane, and change the FieldOrder property to Infix. This tells the valuator to look for the delimiters between different records, but not before the first record or after the last record.
  10. Change the Append New Line and Skip Carriage Return property’s value to No and Skip Line Feed to Yes
  11. Change the delimiter type to the Default Record Delimiter
  12. Add new record to the root node
  13. Select the declaration tab in the right pane and change the name of the node
  14. Select the parse tab and change the properties as it to the root node
  15. Insert the field node
  16. Similarly insert all the nodes and fields
  17. Finally save the specification

You can see the custom specification created for the name value pair (see the name value pair at the end of the page) is in figure below.






Create envelope

User necessary to create the envelopes for processing Custom XML and name value pairs using Biztalk Messaging Manager. The envelope must points to the specification, so that the Biztalk Server interprets the specification and submits the interpreted document to the Interchange interface.

This is the procedure for creating the envelopes.

Open the Biztalk Messaging Manager and do the following steps

  1. On the File menu, select New -> Envelope
  2. Enter the envelope name in the name text box
  3. Select the envelope format as CUSTOM
  4. Check the Envelope Specification and browse for the file path of custom specification
  5. Press OK to create the envelope

Biztalk Orchestration

Biztalk orchestration is to receive the name value pair and do the business processing by using COM+ functions. See below the simple orchestration to receive the name value pair and copy it to the file specified in response port (Without COM+ functionality).





How to call the Orchestration

This is the code to call the orchestration from VS.Net. Here “ChannelNonXML” is the request channel pointed to the request port (NonXmlRequest) and “NonXmlEnvelope” is the envelope name. According to the code it receives the name value pair text (see the text of name value pair below here) from the specified path and submitted to the Biztalk InterchangeClass interface. The Biztalk server interprets the input text with specification specified in envelope and converts into the equivalent xml and calls the Biztalk orchestration.

InterchangeClass BTSObj = new InterchangeClass();
object o= new Object();
object o1= new Object();
string result="";

StreamReader sr = new StreamReader(@"C:/Custom/NonXML/flatfile.txt");
result = sr.ReadToEnd();


BTSObj.SubmitSync(BIZTALK_OPENNESS_TYPE.BIZTALK_OPENNESS_TYPE_NOTOPEN,
result, // the document body
null , // docname
null , // sourcequalifier
null , // sourceid
null , // destqualifier
null , // destid
"ChannelNonXML",
//"ChannelOrderXML", // channel
//"Channel-NCBETelAcc",
null , // filepath
"NonXmlEnvelope", // envelope
0, ref o, ref o1); // passthrough

BTSObj = null ;

Input Name Value Pair

msg_num=660&msg_text= InsertAccount&userid=rosi&password=rosi123&external_account_no=test-rosi-002&external_account_no_type=1&acct_date_created=20040101&acct_code=118&acct_sss_code=18&acct_bill_fname=rosi&acct_bill_lname=Dabre

Output XML Response

<Request>
<msg_numField1="660"/>
<msg_textField1="InsertAccount"/>
<useridField1="rosi"/>
<passwordField1="rosi123"/>
<external_account_noField1="test-rosi-002"/>
<external_account_no_typeField1="1"/>
<acct_date_createdField1="20040101"/>
<acct_tie_codeField1="118"/>
<acct_vip_codeField1="18"/>
<acct_bill_fnameField1="rosi"/>
<acct_bill_lnameField1="Dabre"/>
</Request>

Conclusion

BizTalk server only accepts the XML input to the orchestration. Custom envelope is used to convert the Name Value Pair to the XML, which is suitable for BizTalk orchestration. This article explains the effective way to pass the Name Value Pair to the BizTalk orchestration. Mail us at vinod@dotnetforce.com or rosireddyr@yahoo.com for queries related to this article.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值