Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wcf wsHttpBinding已恢复为基本httpBinding_Wcf - Fatal编程技术网

Wcf wsHttpBinding已恢复为基本httpBinding

Wcf wsHttpBinding已恢复为基本httpBinding,wcf,Wcf,我已经使用wsHttpBinding创建了一个服务,但每次下载该服务时,它都会在客户端的配置中创建basichttpbinding。你知道为什么吗? 坦斯克 可能是.svc标记文件中的服务名称与web.config中指定的名称不匹配 当WCF启动您的服务时,框架会检查.svc文件中的服务名称,然后在web.config中查找与该名称匹配的配置。如果没有找到,则使用默认配置-BasicHttpBinding 要解决您的问题,请执行以下操作: 右键单击FirstService.svc 单击“查看标记

我已经使用wsHttpBinding创建了一个服务,但每次下载该服务时,它都会在客户端的配置中创建basichttpbinding。你知道为什么吗? 坦斯克


可能是.svc标记文件中的服务名称与web.config中指定的名称不匹配

当WCF启动您的服务时,框架会检查.svc文件中的服务名称,然后在web.config中查找与该名称匹配的配置。如果没有找到,则使用默认配置-BasicHttpBinding

要解决您的问题,请执行以下操作:

  • 右键单击FirstService.svc
  • 单击“查看标记”
  • 确保服务属性与web.config中的服务名称属性匹配

  • 我也有同样的问题,但我的服务有效。在我的例子中,我公开了两个绑定,即basichttp和wshttp。我有一个在.NET3.5上新建的测试网站。当它获取服务引用时,它会关闭两个绑定,我会注释掉基本端点。 这一切都很有效

    但是,, 真正的消费者是一个最初在.NET2.0中创建的网站,后来升级到了4.0。因此,我执行与前面相同的过程,注释掉basicHttp端点。但发生的情况是,我在调用服务时遇到异常,它希望发送和接收http,服务器在此测试中拒绝连接

    这必须是与网站升级到4.0,而不是最初在3.5或更高版本创建的东西。我可以看出这是一种升级情况,因为实际的服务使用者站点上不存在通常存在的属性文件夹


    必须有一个标志/设置才能打开,但我不确定是什么。

    是的。。以…开始,以…结束??您确定服务正在工作并正在使用您的配置吗?我怀疑它没有,因为目前您设置了消息安全性,但没有为其配置任何证书。在浏览器中打开服务的WSDL时,您看到了什么?有安全声明吗?我很确定web.config中的配置没有被加载-你能发布FirstService.svc的内容吗?谢谢。我遇到了完全相同的问题,实际上是svc文件和web.config之间的服务名称不匹配
    <system.serviceModel>
        <serviceHostingEnvironment/>
        <bindings>
    
          <wsHttpBinding>
            <binding name="WSHttpBinding" sendTimeout="00:10:00" receiveTimeout="00:59:00" bypassProxyOnLocal="false"
             transactionFlow="false" hostNameComparisonMode="StrongWildcard"
             maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000"
             messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true"
             allowCookies="false">
              <readerQuotas maxDepth="32" maxStringContentLength="50000000"
               maxArrayLength="50000000" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" />
              <reliableSession inactivityTimeout="00:59:00" />
              <security mode="Message">
                <!--<transport clientCredentialType="Windows" proxyCredentialType="None"
           realm="" />-->
                <message clientCredentialType="UserName" negotiateServiceCredential="true"
                 algorithmSuite="Default" establishSecurityContext="true" />
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
    
        <services>
          <service behaviorConfiguration="AdviserPayServiceBehaviour" name="AdviserPay.Services.FirstService.FirstService">
            <endpoint binding="wsHttpBinding" bindingConfiguration="WSHttpBinding" contract="AdviserPay.Services.FirstService.IFirstService" />
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
    
        <behaviors>
          <serviceBehaviors>
            <behavior name="AdviserPayServiceBehaviour">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
              <serviceAuthorization principalPermissionMode="None" impersonateCallerForAllOperations="false" />
              <serviceCredentials>
                <userNameAuthentication userNamePasswordValidationMode="Custom"
                  membershipProviderName="AdviserPayCustomMembershipProvider" />
              </serviceCredentials>
              <serviceSecurityAudit auditLogLocation="Application" suppressAuditFailure="false"
                serviceAuthorizationAuditLevel="None" messageAuthenticationAuditLevel="SuccessOrFailure" />
              <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100" />
            </behavior>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>