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.
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.
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; |
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.
相关文章推荐
- Error:(26, 34) No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/b
- No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/ history_child_
- Error: No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/p
- How to limit an array of similar hashes to those that have more than one of the same key:value pair
- sn.exe error "Failed to generate a strong name key pair -- The keyset is not defined" Thread Tools Rate Thread
- Cannot assign value of type 'AnyObject' to type 'HereIsTheTypeName?'
- No sources that matches the given name (at 'layout_toLeftOf' with value '@id/
- No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/tx_search_frien
- The type org.apache.http.NameValuePair cannot be resolved
- HOWTO get multiple value from the same name checkbox elements or radiobution elements
- how to loop through the Params property for a page and how to display each key/value pair
- BizTalk Adapter Pack for Oracle:Connecting to the LOB system has failed.ORA-1017: invalid name/password
- No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/tx_search_friend
- 修改Activity为AppCompatActivity ,用6.0编译。报错The type org.apache.http.NameValuePair cannot be resolved.
- AndroidStudio HttpEntity,NameValuePair,BasicNameValuePair不能正常导入包
- Q&A: HOW TO FIX XCODE’S "USED AS THE NAME OF THE PREVIOUS PARAMETER" WARNING
- Unable to start debugging on the web server. Logon failure: unknown user name or bad password(web服务器无法启动调试:未知用户名或密码错误)
- ros-indigo卸载不全,出现The package <package name> needs to be reinstalled, but I can’t find an archive for
- 找不R文件切且报 no resource found that matches the given name(“at ' layout_above ' with value ' @id/text_p'
- Verify that the instance name is correct and that SQL Server is configured to allow remote connections.