所述system.serviceModel结合/绑定/的wsHttpBinding没有配置结合 [英] The binding at system.serviceModel/bindings/wsHttpBinding does not have a configured binding

查看:161
本文介绍了所述system.serviceModel结合/绑定/的wsHttpBinding没有配置结合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建我的WCF Web服务的第二个端点。我可以通过将域名网址在浏览器中打开新的端点的快乐页,让我知道,IIS可以找到服务,用我的用户帐户,正常。

但是,如果我尝试运行网页调用服务,我得到以下

错误

 该system.serviceModel绑定/绑定/的wsHttpBinding没有配置
绑定名为WSHttpBinding_IMonetToDss。这是一个无效值
bindingConfiguration。 (D:\\的WebContent \\莫奈\\ web.config行178)。

由于配置文件的这一部分是自动生成由Visual Studio,当我创建服务引用 bindingConfiguration 值为 WSHttpBinding_IMonetToDss ..这它说这不应该。

下面是两个enpoints从web.config拉动。第一个端点 /OKeeffe/OKeeffe.svc 工作正常。为 /OKeeffe/MonetToDss.svc 第二个端点遇到的问题。

 <客户端>
  <端点地址=htt​​p://insidesoap.dev.symetra.com/Escher/EscherService.svc
    绑定=的wsHttpBindingbindingConfiguration =WSHttpBinding_IEscherService
    合同=Escher.IEscherServiceNAME =WSHttpBinding_IEscherService/>
  <端点地址=htt​​p://insideapps.dev.symetra.com/OKeeffe/OKeeffe.svc
    绑定=的wsHttpBindingbindingConfiguration =WSHttpBinding_IAgentPayments
    合同=AgentPayments.IAgentPaymentsNAME =WSHttpBinding_IAgentPayments>
    <同一性GT;
      <的UserPrincipalName值=s.AgentData.dev/>
    < /身份>
  < /端点>
  <端点地址=htt​​p://insideapps.dev.symetra.com/OKeeffe/MonetToDss.svc
    绑定=的wsHttpBindingbindingConfiguration =WSHttpBinding_IMonetToDss
    合同=MonetToDss.IMonetToDssNAME =WSHttpBinding_IMonetToDss>
    <同一性GT;
      <的UserPrincipalName值=s.AgentData.dev/>
    < /身份>
  < /端点>
< /客户>

修改

下面是Web服务配置文件中的 system.serviceModel 部分

 < system.serviceModel>
    <服务和GT;
        <服务名称=OKeeffeDataService.MonetToDss
            behaviorConfiguration =MonetToDssBehaviors>
        <端点地址=
            绑定=的wsHttpBinding
            合同=OKeeffeDataService.IMonetToDss/>
        < /服务>
        <服务名称=OKeeffeDataService.AgentPayments
               behaviorConfiguration =OKeeffeBehavior>
        <端点地址=
                  绑定=的wsHttpBinding
                  合同=OKeeffeDataService.IAgentPayments/>
      < /服务>
    < /服务>
    <&行为GT;
      < serviceBehaviors>
        <行为NAME =OKeeffeBehavior>
          <! - 为了避免泄露的元数据信息,下面设置为false的价值和部署之前删除上面的元数据终结点 - >
          < serviceMetadata httpGetEnabled =真/>
          <! - 要接收故障中的异常细节进行调试,下面设置为true值。设置为false部署之前,以避免泄露异常信息 - >
          < serviceDebug includeExceptionDetailInFaults =真/>
        < /行为>
        <行为NAME =MonetToDssBehaviors>
            < serviceMetadata httpGetEnabled =真/>
            < serviceDebug includeExceptionDetailInFaults =真/>
        < /行为>
      < / serviceBehaviors>
    < /行为>
    < serviceHostingEnvironment multipleSiteBindingsEnabled =真/>
  < /system.serviceModel>


解决方案

您确定您已经定义了一个绑定在你的配置文件命名为WSHttpBinding_IMonetToDss?这样的事情...

 <&绑定GT;
<的wsHttpBinding NAME =WSHttpBinding_IMonetToDss>
...
< /&的wsHttpBinding GT;
<&绑定GT;

I'm trying to create a second endpoint in my WCF web service. I can bring up the new endpoint's "Happy Page" by putting the domain URL in my browser, so I know that IIS can find the service, using my user account, properly.

However, if I try to run the web page that calls the service, I'm getting the error below

The binding at system.serviceModel/bindings/wsHttpBinding does not have a configured 
binding named 'WSHttpBinding_IMonetToDss'. This is an invalid value for 
bindingConfiguration. (D:\webcontent\Monet\web.config line 178).

Since this section of the config file is auto-generated by Visual Studio when I create the service reference the bindingConfiguration value is WSHttpBinding_IMonetToDss.. which it's saying it shouldn't be.

Below are both enpoints pulled from the web.config. The first endpoint /OKeeffe/OKeeffe.svc is working properly. The second endpoint for /OKeeffe/MonetToDss.svc is having the issue.

<client>
  <endpoint address="http://insidesoap.dev.symetra.com/Escher/EscherService.svc"
    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IEscherService"
    contract="Escher.IEscherService" name="WSHttpBinding_IEscherService" />
  <endpoint address="http://insideapps.dev.symetra.com/OKeeffe/OKeeffe.svc"
    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAgentPayments"
    contract="AgentPayments.IAgentPayments" name="WSHttpBinding_IAgentPayments">
    <identity>
      <userPrincipalName value="s.AgentData.dev" />
    </identity>
  </endpoint>
  <endpoint address="http://insideapps.dev.symetra.com/OKeeffe/MonetToDss.svc"
    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMonetToDss"
    contract="MonetToDss.IMonetToDss" name="WSHttpBinding_IMonetToDss">
    <identity>
      <userPrincipalName value="s.AgentData.dev" />
    </identity>
  </endpoint>
</client>

EDIT

Here's the system.serviceModel section of the web service config file

  <system.serviceModel>
    <services>
        <service name="OKeeffeDataService.MonetToDss"
            behaviorConfiguration="MonetToDssBehaviors" >
        <endpoint address=""
            binding="wsHttpBinding"
            contract="OKeeffeDataService.IMonetToDss" />
        </service>
        <service name="OKeeffeDataService.AgentPayments"
               behaviorConfiguration="OKeeffeBehavior" >
        <endpoint address=""
                  binding="wsHttpBinding"
                  contract="OKeeffeDataService.IAgentPayments" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="OKeeffeBehavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- 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"/>
        </behavior>
        <behavior name="MonetToDssBehaviors" >
            <serviceMetadata httpGetEnabled="true" />
            <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>

解决方案

are you sure you have defined a binding named "WSHttpBinding_IMonetToDss" in your config file? something like this...

<bindings>
<wsHttpBinding name="WSHttpBinding_IMonetToDss">
...
</wsHttpBinding>    
<bindings>

这篇关于所述system.serviceModel结合/绑定/的wsHttpBinding没有配置结合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆