小编Nic*_*ike的帖子

IIS 7.5 Wcf https WSDL始终返回空白(错误请求)

其他一切正常,我可以通过https发出SOAP和RESTful调用.但WSDL始终返回空白(错误请求).HTTP返回WSDL很好.

跟踪日志内部异常报告:

The body of the message cannot be read because it is empty.
Run Code Online (Sandbox Code Playgroud)

serviceMetaData标记已设置:

<serviceMetadata
httpGetEnabled="true"
policyVersion="Policy15"
httpsGetEnabled="true" />
Run Code Online (Sandbox Code Playgroud)

web.Config部分绑定:

    <bindings>
        <basicHttpBinding>
            <binding name="soapBinding">
                <security mode="None">
                </security>
            </binding>
        </basicHttpBinding>
        <webHttpBinding>
            <binding name="webBinding">
                <security mode="None">
                </security>
            </binding>
        </webHttpBinding>
    </bindings>
Run Code Online (Sandbox Code Playgroud)

您会立即注意到安全模式="无"

通过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 = …
Run Code Online (Sandbox Code Playgroud)

iis ssl https wcf wsdl

11
推荐指数
1
解决办法
1526
查看次数

标签 统计

https ×1

iis ×1

ssl ×1

wcf ×1

wsdl ×1