Use WCF-SQL XmlPolling to replace old native SQL adapter receive locations without schema change

Microsoft

The old SQL adapter has been thoroughly removed on BizTalk Server 2020. Fortunately it's possible for us to use WCF-SQL adapter's XmlPolling functionality to replace SQL adapter on receive locations without changing and deploying new schemas.

 

Let's use the SQL receive location in RosettaNet DoubleAction as an example.

Below is the old native SQL receive location:

WenJun_Zhang_0-1585710958795.png

 

To make WCF-SQL adapter retrieve the same xml document for you, its binding needs to be configured as the following:

WenJun_Zhang_0-1585712267264.png

WenJun_Zhang_3-1585711271832.png

WenJun_Zhang_4-1585711321668.png

 

A small issue here is that WCF-SQL XmlPolling may add an extra blank namespace to parent node(i.e: MessagesToLOB here) and results in schema validation error.

 

WenJun_Zhang_5-1585711402709.png

 

In this case, a simple solution is to modify your SQL query or stored procedure(e.g: PipAutomationGetAction in this sample) and add a default namespace to the output Xml's parent node (i.e: MessagesToLOB here):

 

ALTER PROCEDURE [dbo].[PipAutomationGetAction]

AS

BEGIN TRANSACTION

DECLARE @tempGUID nvarchar(36)

SELECT TOP 1 @tempGUID = MessageID FROM MessagesToLOB

   WHERE Delivered = 0 AND MessageCategory = 10

  ORDER BY TimeCreated ;

 

WITH XMLNAMESPACES (DEFAULT 'http://DoubleAction.CustomSchema') 

  SELECT PIPInstanceID,DestinationPartyName,SourcePartyName,PIPCode,PIPVersion,ServiceContent FROM MessagesToLOB

   WHERE MessageID = @tempGUID

For xml auto

 

UPDATE MessagesToLOB SET Delivered = 1 WHERE MessageID = @tempGUID

COMMIT TRANSACTION

 

0 Replies