【问题标题】:Azure WCF has https wsdl url but endpoint url is in httpAzure WCF 具有 https wsdl url,但端点 url 在 http
【发布时间】:2012-12-02 05:34:39
【问题描述】:

我正在尝试在 SPD 中访问 Azure WCF。 http wsdl 和端点按预期工作,但 https wsdl 无法处理 https 端点。我打开了 wsdl,只能看到一个 http 端点。

谁能告诉我如何在 wsdl soap:address 位置中有一个 https 端点?

在 SPD for ECT 中使用 https wsdl 和 http 端点我可以连接到 WCF 服务,但它不会生成树视图!

最后它会生成一个错误:“由于内部错误,服务器无法处理请求。有关该错误的更多信息,请打开 IncludeExptionDetailsFaults...blah blah blah " 我很确定配置文件已经有 serviceDebug includeExceptionDetailInFaults="true" 行为

配置

 <system.web>
    <customErrors mode="Off" />
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpsGetEnabled="true" httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true" />
          <useRequestHeadersForMetadataAddress>
            <defaultPorts>
              <add scheme="http" port="80" />
              <add scheme="https" port="443" />
            </defaultPorts>
          </useRequestHeadersForMetadataAddress>
        </behavior>

      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <directoryBrowse enabled="true" />
  </system.webServer>

csdef

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="SPO_LOB" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
  <WebRole name="SPO_LOB" vmsize="Small">
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" />
          <Binding name="HttpsIn" endpointName="HttpsIn" />
        </Bindings>
      </Site>
    </Sites>
    <Certificates>
      <Certificate name="certsvc" storeLocation="LocalMachine"
          storeName="CA" />
    </Certificates>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="80" />
      <InputEndpoint name="HttpsIn" protocol="https" port="443" certificate="democloudsvc1" />
    </Endpoints>
    <Imports>
      <Import moduleName="Diagnostics" />
      <Import moduleName="RemoteAccess" />
      <Import moduleName="RemoteForwarder" />
    </Imports>
    <LocalResources>
      <LocalStorage name="SPO_LOB.svclog" sizeInMB="1000" cleanOnRoleRecycle="false" />
    </LocalResources>
  </WebRole>
</ServiceDefinition>

【问题讨论】:

  • 请发布您的 WCF 服务的 web.config 和 ServiceDefinition.csdef
  • 我使用的是自签名证书,会不会有问题?
  • 停止使用wsdl期间。使用和公开 REST 端点。让您的生活更轻松,不要再死板。
  • 您好@kmanxi:您找到解决方案了吗?我有确切的问题

标签: c# azure wcf-binding sharepoint-designer


【解决方案1】:

您的 mex 端点是如何在 web.config 的服务部分定义的。应该是这样的,

请注意绑定必须是“mexHttpsBinding” - (https)

【讨论】:

  • 在配置中添加了这些行:&lt;service name="Service1" behaviorConfiguration="SVCbehavior"&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="https://localhost:443"/&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;endpoint binding="basicHttpBinding" bindingConfiguration="SecureBasic" name="basicHttpSecure" contract="Service1" /&gt; &lt;endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /&gt; &lt;/service&gt; &lt;/services&gt; 如果成功与否,我会发布结果
【解决方案2】:

添加的 mex 绑定和端点现在位于 https 中

<bindings>
      <basicHttpBinding>
        <binding name="SecureBasic" proxyAddress="http://localhost:80">
          <security mode="Transport">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="SPO_LOB.Service1" behaviorConfiguration="SVCbehavior">
        <host>
          <baseAddresses>
            <add baseAddress="https://localhost:443"/>
          </baseAddresses>
        </host>
        <endpoint binding="basicHttpBinding" bindingConfiguration="SecureBasic" name="basicHttpSecure" contract="SPO_LOB.IService1" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>

现在剩下的问题是,当我将 SPO BCS 连接到服务时,它会生成我上面提到的错误。即使在配置中将 IncludeExceptionDetailInFaults 设置为 true

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-29
    • 1970-01-01
    • 2011-04-14
    相关资源
    最近更新 更多