将SQL存储过程参数添加到现有架构和SendPort

时间:2015-12-01 20:23:05

标签: sql-server biztalk biztalk-2013

这个奇怪的Orch在我碰到它之前工作得很好。我做了两件事:

  1. 修改了以下添加3键,类型和c_date
  2. 的架构
  3. 修改了我的消息转换,以便将这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>
    
  4. 我收到此错误:

    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.
    

    我错过了哪一步?

1 个答案:

答案 0 :(得分:1)

将节点添加到SP架构时,它们必须是

  1. 按照与程序相同的顺序(@key第二个参数,或者您将它放在@data之前?)。
  2. 使用与过程相同的拼写和大小写(在过程中称为@key@Key。)。
  3. 使用与过程期望的数据类型相对应的XSD数据类型(@key一个(N)VARCHAR(N)CHAR?)。
  4. 您收到的错误表示1或2不正确。向我们展示您的程序定义以确定。您还可以在单​​独的(扔掉)项目中重新生成该过程的模式,并将其与您的更改进行比较。