gpt4 book ai didi

wcf - wsHttpBinding 恢复为基本的 httpBinding

转载 作者:行者123 更新时间:2023-12-05 01:27:35 24 4
gpt4 key购买 nike

我已经使用 wsHttpBinding 创建了一个服务,但是每次我下载该服务时,它都会在客户端的配置中创建 basichttpbinding。有什么想法吗?谢谢

<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>

最佳答案

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

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

要解决您的问题:

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

关于wcf - wsHttpBinding 恢复为基本的 httpBinding,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4589895/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com