Ошибка BizTalk: «... Пожалуйста, убедитесь, что ваш входной XML соответствует схеме для операции». - PullRequest
0 голосов
/ 17 октября 2019

В BizTalk недавно произошла следующая ошибка, и я сам не испытывал радости от ее устранения:

The start element with name "TypedPollingResultSet0" and namespace "http://schemas.microsoft.com/Sql/2008/05/TypedPolling/BadgeMaker" was unexpected. Please ensure that your input XML conforms to the schema for the operation.

Сообщение, которое вызывает ошибку, не имеет оркестровки и предназначено исключительно для портов. Порт приема опрашивает хранимую процедуру SQL Server, и схема выглядит следующим образом:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:tns="http://schemas.microsoft.com/Sql/2008/05/TypedPolling/BadgeMaker" xmlns:ns0="https://BadgeMaker.bagemaker_properties" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/Sql/2008/05/TypedPolling/BadgeMaker" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <fileNameHint xmlns="http://schemas.microsoft.com/servicemodel/adapters/metadata/xsd">TypedPolling.BadgeMaker</fileNameHint>
      <schemaInfo is_envelope="yes" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
      <b:imports>
        <b:namespace prefix="ns0" uri="https://BadgeMaker.bagemaker_properties" location=".\bagemaker_properties.xsd" />
      </b:imports>
    </xs:appinfo>
  </xs:annotation>
  <xs:complexType name="TypedPollingResultSet0">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="ID" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="Type" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="MiFare" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="Expiry" nillable="true" type="xs:dateTime" />
      <xs:element minOccurs="0" maxOccurs="1" name="Student_id" nillable="true" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="TypedPollingResultSet0" nillable="true" type="tns:TypedPollingResultSet0">
    <xs:annotation>
      <xs:appinfo>
        <b:properties>
          <b:property name="ns0:PersonID" xpath="/*[local-name()='TypedPollingResultSet0' and namespace-uri()='http://schemas.microsoft.com/Sql/2008/05/TypedPolling/BadgeMaker']/*[local-name()='ID' and namespace-uri()='http://schemas.microsoft.com/Sql/2008/05/TypedPolling/BadgeMaker']" />
        </b:properties>
      </xs:appinfo>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ArrayOfTypedPollingResultSet0">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="TypedPollingResultSet0" type="tns:TypedPollingResultSet0" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ArrayOfTypedPollingResultSet0" nillable="true" type="tns:ArrayOfTypedPollingResultSet0" />
  <xs:element name="TypedPolling">
    <xs:annotation>
      <xs:documentation>
        <doc:action xmlns:doc="http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation">TypedPolling</doc:action>
        <doc:description xmlns:doc="http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation">exec MiFareNotification</doc:description>
      </xs:documentation>
      <xs:appinfo>
        <recordInfo body_xpath="/*[local-name()='TypedPolling' and namespace-uri()='http://schemas.microsoft.com/Sql/2008/05/TypedPolling/BadgeMaker']/*[local-name()='TypedPollingResultSet0' and namespace-uri()='http://schemas.microsoft.com/Sql/2008/05/TypedPolling/BadgeMaker']" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" name="TypedPollingResultSet0" nillable="true" type="tns:ArrayOfTypedPollingResultSet0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Схема «bagemaker», импортированная в эту схему, выглядит следующим образом:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://BadgeMaker.bagemaker_properties" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="https://BadgeMaker.bagemaker_properties" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <b:schemaInfo schema_type="property" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="lost_card_type" type="xs:string">
    <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo propertyGuid="bc02fae8-bcf7-4223-b78f-85d77f7153ac" />
      </xs:appinfo>
    </xs:annotation>
  </xs:element>
  <xs:element name="PersonID" type="xs:string">
    <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo propertyGuid="facb4c50-c234-4824-bd05-be27aaa35ef7" />
      </xs:appinfo>
    </xs:annotation>
  </xs:element>
</xs:schema>

Это тогдасопоставлен с портом отправки, который связан с другой хранимой процедурой SQL Server.

Карта выглядит следующим образом: https://imgur.com/a/Wdn2yvy

Схема для отправки в хранимую процедуру выглядит следующим образом:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <fileNameHint xmlns="http://schemas.microsoft.com/servicemodel/adapters/metadata/xsd">TypedProcedure.dbo</fileNameHint>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="sp">
    <xs:annotation>
      <xs:documentation>
        <doc:action xmlns:doc="http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation">TypedProcedure/dbo/sp</doc:action>
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" name="ID" nillable="true" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="Type" nillable="true" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="Mifare" nillable="true" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="Expiry" nillable="true" type="xs:dateTime" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="sp">
    <xs:annotation>
      <xs:documentation>
        <doc:action xmlns:doc="http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation">TypedProcedure/dbo/sp/response</doc:action>
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="1" name="ReturnValue" type="xs:int" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Я не вижу проблем с портами, хранимыми процедурами или самими схемами;кажется, все соответствует мне. Если я пропустил какую-либо информацию, пожалуйста, дайте мне знать. Я проверил существующие подобные вопросы и сообщения на форуме, но не нашел ничего, что можно было бы применить.

1 Ответ

0 голосов
/ 18 октября 2019

Итак, ошибка выглядит на порту отправки, верно? И это жалуется на TypedPollingResultSet0, который звучит как схема из вашего места получения. Поэтому я подозреваю, что ваше сообщение не отображается в вашей окончательной схеме.

Также убедитесь, что вы проверили, поддерживаете ли вы свойство BTS.Operation на вашем порту отправки или, в качестве альтернативы, поместите значение операции непосредственно в поле действия.

Наконец, вы можете отслеживать свои сообщения и сообщать нам, что на самом деле происходит, основываясь на свойствах сообщений на стороне приема и отправки.

...