IIS 7.5 Wcf https WSDL всегда возвращает пустой (неверный запрос)

Все остальное работает нормально, я могу выполнять вызовы SOAP и RESTful без проблем через https. Но WSDL всегда возвращает пустой (неверный запрос). HTTP возвращает WSDL нормально.

Отчеты о внутренних исключениях журнала трассировки:

The body of the message cannot be read because it is empty.

Установлен тег serviceMetaData:

<serviceMetadata
httpGetEnabled="true"
policyVersion="Policy15"
httpsGetEnabled="true" />

разделы web.Config Привязка:

    <bindings>
        <basicHttpBinding>
            <binding name="soapBinding">
                <security mode="None">
                </security>
            </binding>
        </basicHttpBinding>
        <webHttpBinding>
            <binding name="webBinding">
                <security mode="None">
                </security>
            </binding>
        </webHttpBinding>
    </bindings>

Вы сразу же заметите security mode = "None"

Через ServiceHostFactory я вижу режим для транспортировки как:

        ServiceHost serviceHost = new ServiceHost(service.GetType(), baseAddresses);

        if (ExposeSSL(baseAddresses[0]))
        {
            foreach (var endpoint in serviceHost.Description.Endpoints)
            {
                if (endpoint.Binding is WebHttpBinding)
                {
                    ((WebHttpBinding)endpoint.Binding).Security.Mode = WebHttpSecurityMode.Transport;
                    endpoint.Address = new EndpointAddress(baseAddresses[0].ToString().Replace("http", "https"));
                }
                if (endpoint.Binding is BasicHttpBinding)
                {
                    ((BasicHttpBinding)endpoint.Binding).Security.Mode = BasicHttpSecurityMode.Transport;
                    endpoint.Address = new EndpointAddress(baseAddresses[0].ToString().Replace("http", "https"));
                }
            }

Конфигурация служб:

        <service name="xxxx.Wcf.AdminJsonService" behaviorConfiguration="DefaultBehaviour">
            <host>
                <baseAddresses>
                    <!-- note, choose an available port-->
                    <add baseAddress="http://localhost:62701/json"/>
                </baseAddresses>
            </host>
            <!-- Service Endpoints -->
            <endpoint address="" binding="webHttpBinding" bindingConfiguration="webBinding" behaviorConfiguration="jsonBehavior" bindingNamespace="https://www.xxxx/WebService4/AdminJsonService" contract="xxxx.Wcf.IAdminJsonService"/>
        </service>

        <service name="xxxx.Wcf.AdminXmlService" behaviorConfiguration="DefaultBehaviour">
            <host>
                <baseAddresses>
                    <!-- note, choose an available port-->
                    <add baseAddress="http://localhost:62701/xml"/>
                </baseAddresses>
            </host>
            <!-- Service Endpoints -->
            <endpoint address="" binding="webHttpBinding" bindingConfiguration="webBinding" behaviorConfiguration="poxBehavior" bindingNamespace="https://www.xxx/WebService4/AdminXmlService" contract="xxxx.Wcf.IAdminXmlService"/>
        </service>

        <service name="xxxx.Wcf.AdminSoapService" behaviorConfiguration="DefaultBehaviour">
            <!-- Service Endpoints -->
            <endpoint binding="basicHttpBinding" behaviorConfiguration="soapBehavior" bindingNamespace="https://www.example.com/WebService4/AdminSoapService" contract="xxxx.Wcf.IAdminSoapService"/>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        </service>

Поведение конечной точки

            <!-- SOAP -->
            <behavior name="soapBehavior">
            </behavior>
            <!-- JSON -->
            <behavior name="jsonBehavior">
                <webHttp/>
            </behavior>
            <!-- POX -->
            <behavior name="poxBehavior">
                <webHttp/>
            </behavior>

Поведение службы

            <behavior name="ErrorBehaviour">
                <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
            <behavior name="DefaultBehaviour">
                <NiceErrorHandler/>
                <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                <serviceDebug includeExceptionDetailInFaults="true"/>

                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata
                    httpGetEnabled="true"
                    policyVersion="Policy15"
                    httpsGetEnabled="true" />
            </behavior>

Также есть

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>

У кого-нибудь есть идеи, почему это может происходить?

11
задан Kenster 4 September 2016 в 12:35
поделиться