WCF方法调用返回web服务disco页
我有一个WCF web服务和应用程序,在developerNT中运行良好。我已经在IIS服务器上发布了WCF,并且能够通过防火墙内的web应用程序使用它,并通过服务器名称对其进行寻址。然而,现在我已经把它用于外部,它正在引起问题 我的web应用在尝试连接时出错。我可以从防火墙内外看到服务、disco、wsdl等,但是当我第一次从外部调用身份验证时,服务返回disco页面,而不是处理身份验证方法调用。这导致了ProtocolException,因为据我所知,应用程序需要的是xml,而不是html 同样,完全相同的web应用程序在IIS服务器上运行良好。 一个区别是,外部我是从一个web地址获得它的,内部我使用服务器名称。但该服务使用该网址加载到防火墙外的web浏览器中 部分web应用程序配置:WCF方法调用返回web服务disco页,wcf,discovery,Wcf,Discovery,我有一个WCF web服务和应用程序,在developerNT中运行良好。我已经在IIS服务器上发布了WCF,并且能够通过防火墙内的web应用程序使用它,并通过服务器名称对其进行寻址。然而,现在我已经把它用于外部,它正在引起问题 我的web应用在尝试连接时出错。我可以从防火墙内外看到服务、disco、wsdl等,但是当我第一次从外部调用身份验证时,服务返回disco页面,而不是处理身份验证方法调用。这导致了ProtocolException,因为据我所知,应用程序需要的是xml,而不是html
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding
name="WSHttpBinding_IWebService"
closeTimeout="00:03:00"
openTimeout="00:03:00"
receiveTimeout="00:10:00"
sendTimeout="00:03:00"
bypassProxyOnLocal="false"
transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="5000000"
maxReceivedMessageSize="5000000"
useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="5000000"
maxArrayLength="5000000"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport
clientCredentialType="Windows"
proxyCredentialType="None"
realm="" />
<message
clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default"
establishSecurityContext="true"
/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://<dns address/server address>/WebService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IWebService"
contract="WebServiceRef.IWebService" name="WSHttpBinding_IWebService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</client>
部分服务web.config文件:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding
name="ServiceBinding"
openTimeout="00:03:00"
sendTimeout="00:03:00"
transactionFlow="false"
maxBufferPoolSize="5000000"
maxReceivedMessageSize="5000000">
</binding>
</wsHttpBinding>
</bindings>
<services>
<service
behaviorConfiguration="xxx.WebServiceBehavior"
name="xxx.WebService">
<endpoint
address="http://<dns address/server address>/WebService.svc"
binding="wsHttpBinding"
bindingConfiguration="ServiceBinding"
contract="xxx.IWebService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
/WebService.svc“/>