遭遇 RosettaNet bug
这几天和TI测试时候发现回复的ACK有问题,对方报出来说ServiceHeader里的SignalControl取值有问题
RNIF version 1.1
1.这是收到的数据
<TransactionIdentity>
<GlobalTransactionCode>Notify of Advance Shipment</GlobalTransactionCode>
<InstanceIdentifier>3B2_20080821T0514070001278391</InstanceIdentifier>
</TransactionIdentity>
<ActionControl>
<ActionIdentity>
<GlobalBusinessActionCode>Advance Shipment Notification Action</GlobalBusinessActionCode>
<InstanceIdentifier>1219313753728.30291@dleb2be_te</InstanceIdentifier>
<VersionIdentifier>V01.01</VersionIdentifier>
</ActionIdentity>
2.回复的ACK,变成这样了
<SignalControl>
<inResponseTo>
<ActionIdentity>
<GlobalBusinessActionCode>Advance Shipment Notification Action</GlobalBusinessActionCode>
<InstanceIdentifier>3B2_20080821T0514070001278391</InstanceIdentifier>
</ActionIdentity>
</inResponseTo>
3.理论上回复的ACK应该是去下面的InstanceIdentifier
<SignalControl>
<inResponseTo>
<ActionIdentity>
<GlobalBusinessActionCode>Advance Shipment Notification Action</GlobalBusinessActionCode>
<InstanceIdentifier>1219313753728.30291@dleb2be_te</InstanceIdentifier>
</ActionIdentity>
</inResponseTo>
现在猜测是RosettaNet Accelerator 的一个bug
翻出代码查看,看到这样几行
string propertyValue = bizMessage.GetPropertyValue(typeof(MessageTrackingID)) as string;
其中MessageTrackingID取值XPath为
<b:property name="ns0:MessageTrackingID" xpath="/*[local-name()='ServiceHeader' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='ProcessControl' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='TransactionControl' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='TransactionIdentity' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='InstanceIdentifier' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']" />
也就是
/*[local-name()='ServiceHeader']/*[local-name()='ProcessControl']/*[local-name()='TransactionControl']/*[local-name()='TransactionIdentity']/*[local-name()='InstanceIdentifier']
果然取的是上面的值,确认是bug
怎么办呢,等着测试,要用呢,查找Microsoft KB,果然发现有这方面的问题 support
KB:932368:
FIX: The BizTalk Accelerator for RosettaNet 3.3 incorrectly populates the InstanceIndentifier element in RNIF 1.1 signal messages and response messages in BizTalk Server 2006
打好补丁,注意版本号
Microsoft.solutions.btarn.configurationmanager.dll 3.3.2009.0
发现好了,再看发现代码变成了
string propertyValue = requestMessage.GetPropertyValue(typeof(ActionInstanceIdentifier)) as string;
ActionInstanceIdentifier是什么字段,Microsoft.Solutions.BTARN.Schemas.RNIFv11.ServiceHeaderPartMessageGuideline Schema里这样描述
<b:property name="ns0:ActionInstanceIdentifier" xpath="/*[local-name()='ServiceHeader' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='ProcessControl' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='TransactionControl' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='ActionControl' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='ActionIdentity' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='InstanceIdentifier' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']" />
简化一下就是
/*[local-name()='ServiceHeader']/*[local-name()='ProcessControl']/*[local-name()='TransactionControl']/*[local-name()='ActionControl']/*[local-name()='ActionIdentity']/*[local-name()='InstanceIdentifier']
这就对了,有惊无险.测试通过
文章写出来并没有强调多少技术,只是谈谈自己从猜测到准确定位bug的过程.我想过程比结果更重要,虽然很痛苦,但是...还是我那句话,痛并快乐着!!!