BizTalk 2010 - 无法导入在 ASP.Net Core 2.1 中创建的 WSDL(无法获取元数据)

BizTalk 2010 - Unable to Import WSDL created in ASP.Net Core 2.1 (Failed to get metadata)

WSDL 服务是使用 ASP.Net Core 2.1

创建的

当我添加对 WCF 服务的引用时,我收到错误消息:

Metadata not available 
Failed to get metadata from "http://xxx.xxx.xxx.xxx:port/somewsdl?wsdl".

(Microsoft.BizTalk.Adapter.Wcf.Consuming.MetadataExchange.MetadataExchangeException) Unable to download metadata from "http://xxx.xxx.xxx.xxx:port/somewsdl??wsdl" using WS-Metadata Exchange.
(System.InvalidOperationException) Metadata contains a reference that cannot be resolved: 'http://xxx.xxx.xxx.xxx:port/somewsdl??wsdl'. (System.ServiceModel.CommunicationException) 
The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error. 

web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\somedll.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location>
</configuration>

当我从 SoapUI 测试 wsdl 时,它有效。你能帮帮我吗?

VS 2010 旗舰版 10.0.30319.1
BizTalk Server 2010 版本 3.9.469.0

我做了一个测试以确保这不是旧 VS/BizTalk 的问题:
VS 2015 专业版
BizTalk 服务器 2016

---------------- 已编辑--------------------

我正在使用以下方式添加参考:

当我在“BizTalk WCF 服务使用向导”中使用“元数据文件”时出现错误:

wsdl 文件:

<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" targetNamespace="http://tempuri.org/" name="ISomeImport" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:types>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
            <xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
            <xs:import namespace="http://schemas.datacontract.org/2004/07/System"/>
            <xs:element name="InputData">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" maxOccurs="1" name="template" type="tns:FormTemplateType"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="InputDataResponse">
                <xs:element minOccurs="0" maxOccurs="1" name="InputDataResult" type="tns:FormTemplateResponseType"/>
            </xs:element>
            <xs:complexType name="FormTemplateType">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Changed" type="xs:dateTime"/>
                    <xs:element minOccurs="0" maxOccurs="1" name="Data" type="xs:string"/>
                    <xs:element minOccurs="0" maxOccurs="1" name="Gestor" type="xs:string"/>
                    <xs:element minOccurs="0" maxOccurs="1" name="Identifier" type="xs:string"/>
                    <xs:element minOccurs="0" maxOccurs="1" name="Publisher" type="xs:string"/>
                    <xs:element minOccurs="0" maxOccurs="1" name="Status" type="xs:string"/>
                    <xs:element minOccurs="0" maxOccurs="1" name="Version" type="tns:FormTemplteVersion"/>
                </xs:sequence>
            </xs:complexType>
            <xs:complexType name="FormTemplateResponseType">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Code" type="xs:int"/>
                    <xs:element minOccurs="0" maxOccurs="1" name="Message" type="xs:string"/>
                    <xs:element minOccurs="0" maxOccurs="1" name="TimestampStart" type="xs:string"/>
                    <xs:element minOccurs="0" maxOccurs="1" name="TimestampEnd" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
            <xs:complexType name="FormTemplteVersion">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Major" type="xs:int"/>
                    <xs:element minOccurs="1" maxOccurs="1" name="Minor" type="xs:int"/>
                </xs:sequence>
            </xs:complexType>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="ISomeImport_InputData_InputMessage">
        <wsdl:part name="parameters" element="tns:InputData"/>
    </wsdl:message>
    <wsdl:message name="ISomeImport_InputData_OutputMessage">
        <wsdl:part name="parameters" element="tns:FormTemplateResponseType"/>
    </wsdl:message>
    <wsdl:portType name="ISomeImport">
        <wsdl:operation name="InputData">
            <wsdl:input message="tns:ISomeImport_InputData_InputMessage"/>
            <wsdl:output message="tns:ISomeImport_InputData_OutputMessage"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="BasicHttpBinding" type="tns:ISomeImport">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="InputData">
            <soap:operation soapAction="http://tempuri.org/ISomeImport/InputData" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="ISomeImport">
        <wsdl:port name="BasicHttpBinding" binding="tns:BasicHttpBinding">
            <soap:address location="http://xxx.xxx.xxx.xxx:port/someImport"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

尝试从浏览器浏览 WSDL 文件,将其保存 locally.And 在 WCF 服务使用向导中选择下载的 wsdl 文件。它应该有效。 有 lConsume web service using Wcf-basichttp adapter

问题出在 wsdl 中。

新的 wsdl:

<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/" name="IsomeImport">
    <script/>
    <script/>
    <wsdl:types>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
            <xs:import namespace="http://schemas.datacontract.org/2004/07/someeFormFiller.Models.Interfaces"/>
            <xs:element name="InputData">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/someeFormFiller.Models.Interfaces" minOccurs="0" name="template" nillable="true" type="q1:EFormTemplateType"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="InputDataResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/someeFormFiller.Models.Interfaces" minOccurs="0" name="InputDataResult" nillable="true" type="q2:EFormTemplateResponseType"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/">
            <xs:element name="anyType" nillable="true" type="xs:anyType"/>
            <xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
            <xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
            <xs:element name="boolean" nillable="true" type="xs:boolean"/>
            <xs:element name="byte" nillable="true" type="xs:byte"/>
            <xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
            <xs:element name="decimal" nillable="true" type="xs:decimal"/>
            <xs:element name="double" nillable="true" type="xs:double"/>
            <xs:element name="float" nillable="true" type="xs:float"/>
            <xs:element name="int" nillable="true" type="xs:int"/>
            <xs:element name="long" nillable="true" type="xs:long"/>
            <xs:element name="QName" nillable="true" type="xs:QName"/>
            <xs:element name="short" nillable="true" type="xs:short"/>
            <xs:element name="string" nillable="true" type="xs:string"/>
            <xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
            <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
            <xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
            <xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
            <xs:element name="char" nillable="true" type="tns:char"/>
            <xs:simpleType name="char">
                <xs:restriction base="xs:int"/>
            </xs:simpleType>
            <xs:element name="duration" nillable="true" type="tns:duration"/>
            <xs:simpleType name="duration">
                <xs:restriction base="xs:duration">
                    <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
                    <xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
                    <xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
                </xs:restriction>
            </xs:simpleType>
            <xs:element name="guid" nillable="true" type="tns:guid"/>
            <xs:simpleType name="guid">
                <xs:restriction base="xs:string">
                    <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
                </xs:restriction>
            </xs:simpleType>
            <xs:attribute name="FactoryType" type="xs:QName"/>
            <xs:attribute name="Id" type="xs:ID"/>
            <xs:attribute name="Ref" type="xs:IDREF"/>
        </xs:schema>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/someeFormFiller.Models.Interfaces" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/someeFormFiller.Models.Interfaces">
            <xs:import namespace="http://schemas.datacontract.org/2004/07/System"/>
            <xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
            <xs:complexType xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" name="EFormTemplateType">
                <xs:sequence>
                    <xs:element minOccurs="0" name="Changed" type="xs:dateTime"/>
                    <xs:element minOccurs="0" name="Data" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="Gestor" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="Identifier" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="Publisher" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="Status" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="Version" nillable="true" type="tns:EFormTemplateVersion"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="EFormTemplateType" nillable="true" type="tns:EFormTemplateType"/>
            <xs:complexType xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" name="EFormTemplateVersion">
                <xs:sequence>
                    <xs:element minOccurs="0" name="Major" type="xs:int"/>
                    <xs:element minOccurs="0" name="Minor" type="xs:int"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="EFormTemplateVersion" nillable="true" type="tns:EFormTemplateVersion"/>
            <xs:complexType xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" name="EFormTemplateResponseType">
                <xs:sequence>
                    <xs:element minOccurs="0" name="Code" type="xs:int"/>
                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="TimestampEnd" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="TimestampStart" nillable="true" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="EFormTemplateResponseType" nillable="true" type="tns:EFormTemplateResponseType"/>
        </xs:schema>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="IsomeImport_InputData_InputMessage">
        <wsdl:part name="parameters" element="tns:InputData"/>
    </wsdl:message>
    <wsdl:message name="IsomeImport_InputData_OutputMessage">
        <wsdl:part name="parameters" element="tns:InputDataResponse"/>
    </wsdl:message>
    <wsdl:portType name="IsomeImport">
        <wsdl:operation name="InputData">
            <wsdl:input wsam:Action="http://tempuri.org/IsomeImport/InputData" message="tns:IsomeImport_InputData_InputMessage"/>
            <wsdl:output wsam:Action="http://tempuri.org/IsomeImport/InputDataResponse" message="tns:IsomeImport_InputData_OutputMessage"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="BasicHttpBinding" type="tns:IsomeImport">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="InputData">
            <soap:operation soapAction="http://tempuri.org/IsomeImport/InputData" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="IsomeImport">
        <wsdl:port name="BasicHttpBinding" binding="tns:BasicHttpBinding">
            <soap:address location="http://xxx.xxx.xxx.xxx:port/someImport.svc"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>