DCSIMG
Delivery Notification with Direct Send Port - Ariel ITzhaky

Ariel ITzhaky

It's all working till you fix it ...

Delivery Notification with Direct Send Port

It's been a while I'm trying to understand how to perform a Delivery Notification on a BizTalk Direct Logical Send Port. All the samples and the posts around the issue never mentioned sending the message directly into the MsgBox. They all talked about the guidance of performing the ACK/NACK on a Specify Later, Specify Now or Dynamic port configuration - not Direct.

Well here is how I did it on a Direct style:
1.
    
Assuming the message I'm trying to send (and check for delivery) is called msgDeliver, On a Message Assignment Shape before the Direct Send Shape, write the following:

//Restore the original message using XmlDocument
msgDeliver = xDoc;
//Set the Acknowlegment Flag to true
msgDeliver(BTS.AckRequired) = true;
//Generate a correlation token
msgDeliver(BTS.CorrelationToken) = System.Convert.ToString(System.Guid.NewGuid());
//Set a routing value like the SPTransport

msgDeliver(BTS.SPTransportID)="{4504D95B-5E81-42CF-912D-17A7362E2024}";


2.
    
Add a Send Shape to send the msgDeliver message and link it to a logical Direct Send Port.
3.
    
Create three separate Correlation Sets for BTS.AckRequired, BTS.CorrelationToken and BTS.SPTransportID.
4.
    
Configure the Send Shape to Init the three above correlation sets.
5.
    
Create a new message and call it msgAckNack of type - System.Xml.XmlDocument.
6.
    
Under the send shape add two Direct Receive Shapes, config them to follow the correlation for BTS.CorrelationToken (the first is a dummy subscription for the message sent and the second is for the SOAP NACK message, or the kind of empty ACK message).
7.
    
Configure the two receive shapes to get the msgAckNack message, and link the two receive shapes to a logical direct receive port.
8.
    
Now you can analyze the msgAckNack and see if the message was deivered safely (no need of a Scope shape to get the DeliveryNotification exception because there the NACK is not interprated here as an exception).

9.     On a succesful delivery the msgAckNack will contain something like:
<String/>
and on a failing delivery it will contain a SOAP message like that:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP:Body><SOAP:Fault><faultcode>Microsoft BizTalk Server Negative Acknowledgment </faultcode><faultstring>An error occurred while processing the message, refer to the details section for more information </faultstring><faultactor>C:\TestSendListen\Send1\%MessageID%.xml</faultactor><detail><ns0:NACK Type="NACK" xmlns:ns0="http://schema.microsoft.com/BizTalk/2003/NACKMessage.xsd"><NAckID>{0BC59C8E-45A2-4292-B1FA-05D1ABA00D27}</NAckID><ErrorCode>0xc0c01c10</ErrorCode><ErrorCategory>0</ErrorCategory><ErrorDescription>The FILE send adapter cannot open file C:\TestSendListen\Send1\{846067E1-5C29-4EAE-9308-401B7F913B4F}.xml for writing.
 Details: The system cannot find the path specified.
 </ErrorDescription></ns0:NACK></detail></SOAP:Fault></SOAP:Body></SOAP:Envelope>

Comments

TrackBack said:

# June 23, 2008 12:33 PM

siva said:

Hi,

I followed same as above however it is not working for me. My proreject is little different from this. I have one orchestration. I receive the message in orch, then i corraleted AckRequied, CorrelatedToaken + ID (for filter it on send sport) same as above. Then I send the message. Partner is receiving the message however i am not receiving the ack or nack. it looks like orch is keep running/waitting.

I am using 2 way http port and i have outbound and inbound mappings in the http port. So partner is not receiving the original msg. it get mapped in the send-recive port.

Do you think this might be the reason?

How can get ack or nack if:

I receive msg in orch and map it to partners schema on direck send-receive port and sent it to them and map the response to our standared in the port. This is HTTP prot.

Thank you in advance.

# November 27, 2008 3:00 PM

Naveen said:

I am not sure why we even need such a scenario.

Why do we need to keep track of NACK

when we are sending a message to message box

using direct binding.

In direct binding, we use the Send port

to place a message into the message box,

then why do we need to track for NACK at all??

# February 11, 2009 9:27 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: