0

我有一个独特的问题。我使用 wsHttpBinding 托管了一个 WCF 服务。具有绑定配置的 server.config 文件如下所示:

<system.serviceModel>
     <services>
      <service behaviorConfiguration="SafeSerice.ServiceBehavior" name="NEPLANWEBV18.1.Services.External.NeplanService">
        <endpoint address="" binding="wsHttpBinding" contract="NEPLANWEBV18.1.External.INeplanService" bindingConfiguration="SafeServiceConf">
        </endpoint>
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
         <binding name="SafeServiceConf" closeTimeout="00:05:00" openTimeout="00:10:00" receiveTimeout="01:20:00" sendTimeout="01:20:00" maxReceivedMessageSize="2147483647">
          <security mode="TransportWithMessageCredential">
            <message clientCredentialType="UserName" />
          </security>
          <readerQuotas maxArrayLength="2147483646" maxBytesPerRead="65536" maxStringContentLength="2147483646" />
        </binding>
      </wsHttpBinding>
    </bindings>

但是,在 IIS 7.0 中托管它之后,当我浏览和查看 WSDL 时,绑定如下:

<wsdl:binding name="BasicHttpBinding_NeplanService" type="i0:NeplanService">

我在哪里犯错?对于这项服务,我需要 wsHttpBinding。如果有人能对此事有所了解,我将不胜感激。

4

1 回答 1

0

经过长时间的困惑后得到了答案。我把服务名给错了。由于它无法找到服务,它默认为 basichttp 绑定。

于 2012-11-13T09:40:42.343 回答