您的位置:首页 > 产品设计 > UI/UE

Passing Name Value Pair to the Biztalk Orchestration

2004-09-06 14:43 393 查看
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

On the File menu, click New.
The New Document Specification dialog box appears.
Click Blank Specification and click OK.
Select Declaration in the right pane and change the name as it meaning full main node (for our request change “Blank Specification” as “Request”)
Select the Reference tab and Double-click the Value field in the Standard row.
In the Standard list, click CUSTOM and press ENTER.
Click Yes to confirm the change.
Change the Default Record Delimiter value to & (0x26).
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.
Change the Append New Line and Skip Carriage Return property’s value to No and Skip Line Feed to Yes
Change the delimiter type to the Default Record Delimiter
Add new record to the root node
Select the declaration tab in the right pane and change the name of the node
Select the parse tab and change the properties as it to the root node
Insert the field node
Similarly insert all the nodes and fields
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

On the File menu, select New -> Envelope
Enter the envelope name in the name text box
Select the envelope format as CUSTOM
Check the Envelope Specification and browse for the file path of custom specification
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐