为什么我无法查看 WCF 服务的 WSDL 内容?
当我导航到 WCF svc 页面时 https://mywebstie.project.com/myproject/myuploadservice.svc ,我按预期点击了 svc,但它提供的 svcutil URL 使用实际的服务器名称;例如,不是 mywebsite.project.com URL。
当我点击提供的 WSDL 文件链接时,仅显示文本 https://mywebstie.project .com/myproject/myuploadservice.svc/SQLMembershipProvider 在浏览器中呈现。浏览器中的 URL 实际上使用的是服务器名称,而不是 mywebstie.project.com。
不会呈现 WSDL XML 的内容。
可能是什么问题?我没有更改我的客户端或服务器配置,但我的服务无法正常工作。
接收对 https://mywebstie.project.com/myproject/ 的 HTTP 响应时发生错误myuploadservice.svc/SqlMembershipProvider。这可能是由于服务端点绑定不使用 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>
when i navigate to my WCF svc page https://mywebstie.project.com/myproject/myuploadservice.svc, i hit the svc as expected but the svcutil URL it supplies uses the actual server name; not the mywebsite.project.com URL, for example.
When i follow the provided link to the WSDL file, only the text https://mywebstie.project.com/myproject/myuploadservice.svc/SQLMembershipProvider is rendered in the browser. The URL in the browser is actually using the server name instead of mywebstie.project.com.
The contents of the WSDL XML are not rendered.
What might the problem be? i haven't changed my client or server configurations but my service is not working.
An error occurred while receiving the HTTP response to https://mywebstie.project.com/myproject/myuploadservice.svc/SqlMembershipProvider. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
Here's my server config
<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>
The client looks like this:
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于您的 WSDL 问题:浏览 WSDL 时不要使用 Chrome。
For your WSDL problem: Don't use Chrome when browsing WSDL.