加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 为什么我的WSDL仍然显示基本的http绑定与http的位置值?

发布时间:2020-12-15 04:35:43 所属栏目:百科 来源:网络整理
导读:我启用了https绑定,但我的WSDL的SOAP地址为http.有什么想法吗?谢谢! wsdl:service name="XXXX"wsdl:port name="BasicHttpBinding_XXXXService" binding="i0:BasicHttpBinding_XXXService" soap:address location="http://dev-soa-app/XXXX/XXXX/XXXService
我启用了https绑定,但我的WSDL的SOAP地址为http.有什么想法吗?谢谢!
<wsdl:service name="XXXX"><wsdl:port name="BasicHttpBinding_XXXXService" binding="i0:BasicHttpBinding_XXXService">
    <soap:address location="http://dev-soa-app/XXXX/XXXX/XXXService.svc"/></wsdl:port>
</wsdl:service>

这是我的web.config文件:

<?xml version="1.0"?>
<configuration>

  <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <configProtectedData>
    <providers>
      <add name="ConnStrings" type="System.Configuration.RsaProtectedConfigurationProvider,System.Configuration,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" keyContainerName="ConnStrings" cspProviderName="" useMachineContainer="true" uSEOAEP="false"/>
    </providers>
  </configProtectedData>
  <connectionStrings configSource="ConnStringsConnStrings.config"/>
  <system.serviceModel>
    <services>
      <service name="XXXXService">
        <!-- Use a bindingNamespace to eliminate tempuri.org -->
        <endpoint address=""  name="XXXXService"
                  binding ="wsHttpBinding" bindingConfiguration="TransportSecurity"
                  bindingNamespace="WF.CT2.WebServices.XXXXService"
                  contract="WF.CT2.WebServices.XXXXService.SAMLService" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="TransportSecurity">
          <security mode="Transport">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information,set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpsGetEnabled="true" httpGetEnabled ="false" />
          <!-- 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="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

解决方法

首先,您应该意识到WSDL的service元素中的URL只是一个提示.您的客户不应该依赖于此服务的正确地址.

其次,要意识到如果您的服务托管在IIS中,那么它就是IIS,它根据IIS中的绑定确定要放置在该元素中的地址.我怀疑您在托管服务的站点上启用了HTTP和HTTPS.您通常可以通过在IIS管理器中的SSL页面上设置“需要SSL”属性将其切换为仅HTTPS.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读