为什么我的WSDL仍然显示基本的http绑定与http的位置值? [英] Why my WSDL still shows basic http binding with the location value of http?

查看:120
本文介绍了为什么我的WSDL仍然显示基本的http绑定与http的位置值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我启用了https绑定,但我的WSDL的肥皂地址为http。有什么想法吗?谢谢!

I enabled https binding, but my WSDL has soap address of http. Any ideas why? Thanks!

<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文件:

Here is my web.config file:

<?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="ConnStrings\ConnStrings.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>


推荐答案

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

First of all, you should realize that the URL in the service element of the WSDL is only a hint. Your clients should not be depending on this being the correct address of the service.

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

Second, realize that if your service is hosted in IIS, then it is IIS which determines the address to place in that element, based on your bindings in IIS. I suspect that you have both HTTP and HTTPS enabled on the site hosting the service. You can usually switch this to just HTTPS by setting the "Require SSL" property on the SSL page in IIS Manager.

这篇关于为什么我的WSDL仍然显示基本的http绑定与http的位置值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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