我有最烦人的问题;
我有一个编排对视图进行查找。它适用于本地和我们的开发服务器,但不适用于 QA 或 UAT。相同的代码。相同的观点。只是环境不同。
为了对此进行测试并确保它不是编码问题,我使用本地 BizTalk,将端口配置为服务器 A,发出一条消息,它按预期工作。然后我将发送端口的配置更改为服务器 B(这就是我所做的全部更改)并在其中触发相同的消息,但它失败了。
对于 SAME 视图的相同操作,我得到两个错误之一,因此即使错误消息也不一致。
Event Type: Warning
Event Source: BizTalk Server 2009
Event Category: (1)
Event ID: 5743
Date: 13/01/2010
Time: 16:53:07
User: N/A
Computer: VM-RC-BTS2009
Description:
The adapter failed to transmit message going to send port "AX Lookup CRM_CUST" with URL "mssql://server//db?". It will be retransmitted after the retry interval specified for this Send Port.
Details:"Microsoft.ServiceModel.Channels.Common.XmlReaderGenerationException:
The columns BANKACCOUNTRECID and BLOCKED are either duplicated or not in a sequence. Each column can only be selected one time, and columns must be selected in sequence.
at Microsoft.Adapters.Sql.SelectBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriter.WriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.WriteBodyContents(XmlDictionaryWriter writer)
at Microsoft.Adapters.AdapterUtilities.AdapterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.WriteBodyContents(XmlDictionaryWriter writer)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfMarshaller.CreateBizTalkMessageStream(Message wcfMessage, IAdapterConfigInboundMessageMarshalling config)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfMarshaller.CreateBizTalkMessage(IBaseMessageFactory messageFactory, IAdapterConfigInboundMessageMarshalling marshallingConfig, Message wcfMessage)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)".
或者
Event Type: Warning
Event Source: BizTalk Server 2009
Event Category: (1)
Event ID: 5743
Date: 13/01/2010
Time: 16:45:49
User: N/A
Computer: VM-RC-BTS2009.ad.integralgroup.co.nz
Description:
The adapter failed to transmit message going to send port "AX Lookup CRM_CUST" with URL "mssql://vm-lesmillsnzqa.aplplus.local//LMNZ_AX_Improve?". It will be retransmitted after the retry interval specified for this Send Port.
Details:"Microsoft.ServiceModel.Channels.Common.XmlReaderGenerationException:
The columns ACCOUNTNUM and BANKACCOUNTRECID are either duplicated or not in a sequence. Each column can only be selected one time, and columns must be selected in sequence.
at Microsoft.Adapters.Sql.SelectBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriter.WriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.WriteBodyContents(XmlDictionaryWriter writer)
at Microsoft.Adapters.AdapterUtilities.AdapterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.WriteBodyContents(XmlDictionaryWriter writer)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfMarshaller.CreateBizTalkMessageStream(Message wcfMessage, IAdapterConfigInboundMessageMarshalling config)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfMarshaller.CreateBizTalkMessage(IBaseMessageFactory messageFactory, IAdapterConfigInboundMessageMarshalling marshallingConfig, Message wcfMessage)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)".
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
我要求<Columns>*</Columns>
和<Query>WHERE FIELD='xyz'</Query>
这是实际的消息;
<ns0:Select xmlns:ns3="http://schemas.microsoft.com/Sql/2008/05/Types/Views/dbo" xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/ViewOp/dbo/CRM_CUST">
<ns0:Columns>*</ns0:Columns>
<ns0:Query>WHERE ACCOUNTNUM='id_0'</ns0:Query>
</ns0:Select>
然后我有一个带有sqlbinding
. 这是配置
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<client>
<endpoint address="mssql://devserver//DbName?" behaviorConfiguration="EndpointBehavior" binding="sqlBinding" bindingConfiguration="sqlBinding" contract="BizTalk" name="CUST Lookup" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="EndpointBehavior" />
</endpointBehaviors>
</behaviors>
<bindings>
<sqlBinding>
<binding name="sqlBinding" useAmbientTransaction="false" />
</sqlBinding>
</bindings>
</system.serviceModel>
</configuration>
以及在动作映射中的设置;
ViewOp/Select/dbo/CRM_CUST
-- 视图名称