1. Open the BizTalk Server Administrator Console and expand your BizTalk application.
2. Right-click on the Receive Location and select “New” and then “One-Way Receive Location”. Choose your receive port and click the OK button.
3. Type a proper name for the receive location, choose the transport type as WCF-SQL, and select the Receive handler. If the WCF-SQL type is not available, please install it from the BizTalk setup and add the adapter from Platform settings. Leave the receive pipeline as XML Receive.
5. Click on the Binding Tab and expand the (FOR XML) section. In the XMLStoredProcedureRootNodeName field, enter the XML root name of your schema where you want to retrieve table value in your schema tags. Then, in the XmlStoredProcedureRootNodeNamespace field, enter the target namespace from the same schema (.xsd file).
6. Repeat the same process in the Binding Tab for the General Property of Timeout value. For more information, please read my post on Configuring BizTalk WCF Timeout Values on a Binding.
The above procedure has two main points:
i) WITH XMLNAMESPACES (DEFAULT ‘http://BizTalkLive_WCF_SQL.AccountRequest’) If you haven’t defined the default target namespace of your schema, then when you enable your WCF-SQL Receive location, it won’t map with your schema as called in the receive location, and you’ll get an error in your BizTalk console. In the SQL query, the “WITH” expression is mandatory to break the “;” (semicolon), otherwise, when you compile your procedure, you’ll receive the following error:
“Incorrect syntax near the keyword ‘with’. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.”
ii) Table name and attribute should be the same as in the XML Root/Record and Attributes/Elements, respectively, as returned in the SQL query. Please see the XML schema of the above procedure below –
“That’s it, all configuration has been completed.”
