为什么我不能查看我的WCF服务的WSDL的内容?

时间:2010-09-29 13:55:14

标签: wcf wsdl endpoint

当我导航到我的WCF svc页面https://mywebstie.project.com/myproject/myuploadservice.svc时,我按预期命中svc,但它提供的svcutil URL使用实际的服务器名称;例如,不是mywebsite.project.com网址。

当我按照提供的WSDL文件链接时,只在浏览器中呈现文本https://mywebstie.project.com/myproject/myuploadservice.svc/SQLMembershipProvider。浏览器中的URL实际上使用的是服务器名称而不是mywebstie.project.com。

不呈现WSDL XML的内容。

问题可能是什么?我没有更改我的客户端或服务器配置,但我的服务无法正常工作。

接收到https://mywebstie.project.com/myproject/myuploadservice.svc/SqlMembershipProvider的HTTP响应时发生错误。这可能是由于服务端点绑定不使用HTTP协议。这也可能是由于服务器中止HTTP请求上下文(可能是由于服务关闭)。有关详细信息,请参阅服务器日志。

这是我的服务器配置

  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MembershipBehaviour">
          <serviceMetadata httpsGetEnabled="true" />
          <serviceCredentials>
            <serviceCertificate findValue="44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44"
              storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" />
            <userNameAuthentication userNamePasswordValidationMode="MembershipProvider"
              membershipProviderName="SqlMembershipProvider" />
          </serviceCredentials>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <wsHttpBinding>
        <binding name="SqlMembershipProvider">
          <security mode="TransportWithMessageCredential">
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </wsHttpBinding>
      <mexHttpsBinding>
        <binding name="mex" />
      </mexHttpsBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="MembershipBehaviour" name="Test.Web.Services.MyUploadService">
        <endpoint name="SqlMembershipProvider"
                  address="https://mywebstie.project.com/myproject/myuploadservice.svc/SQLMembershipProvider"
                  binding="wsHttpBinding" bindingConfiguration="SqlMembershipProvider"
                  contract="Test.Web.Services.IMyUploadService" />
        <endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration="mex" name="mex" contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>

客户端看起来像这样:

<system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="SqlMembershipProvider" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                allowCookies="false">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <reliableSession ordered="true" inactivityTimeout="00:10:00"
                    enabled="false" />
                <security mode="TransportWithMessageCredential">
                    <transport clientCredentialType="Certificate" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" negotiateServiceCredential="true"
                        algorithmSuite="Default" establishSecurityContext="true" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://mywebstie.project.com/myproject/myuploadservice.svc/SQLMembershipProvider"
            binding="wsHttpBinding" bindingConfiguration="SqlMembershipProvider"
            contract="IHoldingFileUploadService" name="SqlMembershipProvider">
            <identity>
                <certificate encodedValue="SomeEncodedValue" />
            </identity>
        </endpoint>
    </client>
</system.serviceModel>

1 个答案:

答案 0 :(得分:5)

对于您的WSDL问题:浏览WSDL时不要使用Chrome。