将 SQL 个存储过程参数添加到现有架构和 SendPort
Adding SQL Stored Procedure Parameters to an existing Schema and SendPort
在我接触这个 biztalk Orch 之前,它工作得很好。我做了两件事:
- 修改了下面的架构,添加了 3 个键、类型和 c_date
修改了我的消息转换,以便将这 3 个附加参数映射到目标架构。
<?xml version="1.0" encoding="utf-16"?>
<schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:ns3="http://schemas.datacontract.org/2004/07/System.Data" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo" version="1.0" xmlns="http://www.w3.org/2001/XMLSchema">
<import schemaLocation=".\sqlBinding_System_x2eData.xsd" namespace="http://schemas.datacontract.org/2004/07/System.Data" />
<annotation>
<appinfo>
<fileNameHint xmlns="http://schemas.microsoft.com/servicemodel/adapters/metadata/xsd">Procedure.dbo</fileNameHint>
<references xmlns="http://schemas.microsoft.com/BizTalk/2003">
<reference targetNamespace="http://schemas.datacontract.org/2004/07/System.Data" />
</references>
</appinfo>
</annotation>
<element name="Vendor_Receive_IPN_Message_sp">
<annotation>
<documentation>
<doc:action xmlns:doc="http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation">Procedure/dbo/Vendor_Receive_IPN_Message_sp</doc:action>
</documentation>
</annotation>
<complexType>
<sequence>
<element minOccurs="0" maxOccurs="1" name="data" nillable="true" type="string" />
<element minOccurs="0" maxOccurs="1" name="key" nillable="true" type="string" />
<element minOccurs="0" maxOccurs="1" name="type" nillable="true" type="string" />
<element minOccurs="0" maxOccurs="1" name="c_date" nillable="true" type="dateTime" />
</sequence>
</complexType>
</element>
<element name="Vendor_Receive_IPN_Message_spResponse">
<annotation>
<documentation>
<doc:action xmlns:doc="http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation">Procedure/dbo/Vendor_Receive_IPN_Message_sp/response</doc:action>
</documentation>
</annotation>
<complexType>
<sequence>
<element minOccurs="0" maxOccurs="1" name="Vendor_Receive_IPN_Message_spResult" nillable="true" type="ns3:ArrayOfDataSet" />
<element minOccurs="1" maxOccurs="1" name="ReturnValue" type="int" />
</sequence>
</complexType>
</element>
</schema>
我收到此错误:
The adapter failed to transmit message going to send port "SendPort IPN Message to SQL" with
URL "mssql://myserver:1433//mydb?". It will be retransmitted after
the retry interval specified for this Send Port.
Details:"Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException:
The start element with name "key" and namespace
"http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo" was unexpected.
Please ensure that your input XML conforms to the schema for the operation.
我错过了哪一步?
当您将节点添加到 SP 模式时,它们必须是
- 与程序中的顺序相同(
@key
是第二个参数,还是您将它放在 @data
之前?)。
- 使用与程序相同的拼写和大小写(程序中是叫
@key
还是@Key
?)。
- 使用与过程期望的数据类型对应的 XSD 数据类型(
@key
是 (N)VARCHAR
还是 (N)CHAR
?)。
您收到的错误表明 1 或 2 不正确。向我们展示您的程序定义以确保。您还可以在单独的(丢弃的)项目中为过程重新生成架构,并将其与您的更改进行比较。
在我接触这个 biztalk Orch 之前,它工作得很好。我做了两件事:
- 修改了下面的架构,添加了 3 个键、类型和 c_date
修改了我的消息转换,以便将这 3 个附加参数映射到目标架构。
<?xml version="1.0" encoding="utf-16"?> <schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:ns3="http://schemas.datacontract.org/2004/07/System.Data" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo" version="1.0" xmlns="http://www.w3.org/2001/XMLSchema"> <import schemaLocation=".\sqlBinding_System_x2eData.xsd" namespace="http://schemas.datacontract.org/2004/07/System.Data" /> <annotation> <appinfo> <fileNameHint xmlns="http://schemas.microsoft.com/servicemodel/adapters/metadata/xsd">Procedure.dbo</fileNameHint> <references xmlns="http://schemas.microsoft.com/BizTalk/2003"> <reference targetNamespace="http://schemas.datacontract.org/2004/07/System.Data" /> </references> </appinfo> </annotation> <element name="Vendor_Receive_IPN_Message_sp"> <annotation> <documentation> <doc:action xmlns:doc="http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation">Procedure/dbo/Vendor_Receive_IPN_Message_sp</doc:action> </documentation> </annotation> <complexType> <sequence> <element minOccurs="0" maxOccurs="1" name="data" nillable="true" type="string" /> <element minOccurs="0" maxOccurs="1" name="key" nillable="true" type="string" /> <element minOccurs="0" maxOccurs="1" name="type" nillable="true" type="string" /> <element minOccurs="0" maxOccurs="1" name="c_date" nillable="true" type="dateTime" /> </sequence> </complexType> </element> <element name="Vendor_Receive_IPN_Message_spResponse"> <annotation> <documentation> <doc:action xmlns:doc="http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation">Procedure/dbo/Vendor_Receive_IPN_Message_sp/response</doc:action> </documentation> </annotation> <complexType> <sequence> <element minOccurs="0" maxOccurs="1" name="Vendor_Receive_IPN_Message_spResult" nillable="true" type="ns3:ArrayOfDataSet" /> <element minOccurs="1" maxOccurs="1" name="ReturnValue" type="int" /> </sequence> </complexType> </element> </schema>
我收到此错误:
The adapter failed to transmit message going to send port "SendPort IPN Message to SQL" with
URL "mssql://myserver:1433//mydb?". It will be retransmitted after
the retry interval specified for this Send Port.
Details:"Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException:
The start element with name "key" and namespace
"http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo" was unexpected.
Please ensure that your input XML conforms to the schema for the operation.
我错过了哪一步?
当您将节点添加到 SP 模式时,它们必须是
- 与程序中的顺序相同(
@key
是第二个参数,还是您将它放在@data
之前?)。 - 使用与程序相同的拼写和大小写(程序中是叫
@key
还是@Key
?)。 - 使用与过程期望的数据类型对应的 XSD 数据类型(
@key
是(N)VARCHAR
还是(N)CHAR
?)。
您收到的错误表明 1 或 2 不正确。向我们展示您的程序定义以确保。您还可以在单独的(丢弃的)项目中为过程重新生成架构,并将其与您的更改进行比较。