绑定wsdl和配置文件中的不匹配

时间:2012-11-12 14:35:34

标签: wcf iis-7 wcf-binding

我有一个独特的问题。我已经使用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。 如果有人能对这件事情有所了解,我将非常感激。

1 个答案:

答案 0 :(得分:0)

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