C# WCF REST服务已停止工作,甚至BasicHttpBinding也失败
更新 好吧,在我的头撞了几下之后,我终于重新创建了这个服务。虽然我现在还不确定实际的根本原因,但我做的一个更改是使用标准的System.ServiceModel.Activation.WebServiceHostFactory,而不是我们通常使用的自定义工厂,现在一切都正常了 我已经花了两天的时间试图弄明白这一点,但我仍然迷路了,希望有人能帮助我。我有一个restful服务,它也有一个soap端点,直到上周二为止,它运行得非常出色。现在,突然之间,在VS 2013中构建时生成的wsdl完全不正常了,所有端点都不起作用。我已经经历了一切,将代码和配置设置恢复到周二(5月10日)之前,但仍然无法使其工作。我已经清除了我的ASP.Net临时文件,我重置了IIS,清除了代码并使其变得新鲜,我能想到的一切 每当我尝试通过REST路径访问服务时,我都会收到未找到端点的消息,当我尝试通过基本路由访问服务时,我会收到一条指示HTTP 415错误的消息。我包括了我的服务配置的部分以供参考,但自周二以来,这一部分也没有改变。我们还尝试将其部署到其他机器上,并在其他dev机器上进行测试,得到了相同的结果。我故意删除了一些名字。任何帮助都将不胜感激C# WCF REST服务已停止工作,甚至BasicHttpBinding也失败,c#,asp.net,web-services,wcf,rest,C#,Asp.net,Web Services,Wcf,Rest,更新 好吧,在我的头撞了几下之后,我终于重新创建了这个服务。虽然我现在还不确定实际的根本原因,但我做的一个更改是使用标准的System.ServiceModel.Activation.WebServiceHostFactory,而不是我们通常使用的自定义工厂,现在一切都正常了 我已经花了两天的时间试图弄明白这一点,但我仍然迷路了,希望有人能帮助我。我有一个restful服务,它也有一个soap端点,直到上周二为止,它运行得非常出色。现在,突然之间,在VS 2013中构建时生成的wsdl完全不正常
<system.serviceModel>
<bindings>
<customBinding>
<binding name="FdrBinding" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:05:00" sendTimeout="00:05:00">
<textMessageEncoding messageVersion="Soap11">
<readerQuotas maxArrayLength="16384" maxBytesPerRead="4096" maxDepth="32" maxStringContentLength="5242880"/>
</textMessageEncoding>
<security includeTimestamp="true" authenticationMode="MutualCertificate" defaultAlgorithmSuite="Basic128Sha256Rsa15" securityHeaderLayout="LaxTimestampLast" enableUnsecuredResponse="true" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" />
<httpsTransport maxReceivedMessageSize="5242880" maxBufferPoolSize="5242880" maxBufferSize="5242880" proxyAddress="http://10.10.1.54:80" bypassProxyOnLocal="false" useDefaultWebProxy="false" />
</binding>
</customBinding>
<netTcpBinding>
<binding name="DASBDI_NetTcpBinding" closeTimeout="00:59:00" openTimeout="00:59:00" receiveTimeout="00:59:00" sendTimeout="00:59:00" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="16384" maxBytesPerRead="4096" />
</binding>
<binding name="DASFDR_NetTcpBinding" closeTimeout="00:59:00" openTimeout="00:59:00" receiveTimeout="00:59:00" sendTimeout="00:59:00" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="16384" maxBytesPerRead="4096" />
</binding>
<binding name="TMGTokenService_NetTcpBinding" closeTimeout="00:59:00" openTimeout="00:59:00" receiveTimeout="00:59:00" sendTimeout="00:59:00" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="16384" maxBytesPerRead="4096" />
</binding>
<binding name="DASSymConnect_NetTcpBinding" closeTimeout="00:59:00" openTimeout="00:59:00" receiveTimeout="00:59:00" sendTimeout="00:59:00" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="16384" maxBytesPerRead="4096" />
</binding>
</netTcpBinding>
<basicHttpBinding>
<binding name="AccountViewsSoap" maxReceivedMessageSize="2147483647">
<security mode="Transport" />
</binding>
<binding name="AccountViewsSoap1" />
<binding name="AccountMaintenanceSoap" maxReceivedMessageSize="2147483647">
<security mode="Transport" />
</binding>
<binding name="AccountMaintenanceSoap1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://openservices.beta.themembersgroup.com/accountviews.asmx"
binding="basicHttpBinding" bindingConfiguration="AccountViewsSoap"
contract="AccountViewsService.AccountViewsSoap" name="AccountViewsSoap" />
<endpoint address="https://openservices.beta.themembersgroup.com/accountmaintenance.asmx"
binding="basicHttpBinding" bindingConfiguration="AccountMaintenanceSoap"
contract="AccountMaintenanceService.AccountMaintenanceSoap"
name="AccountMaintenanceSoap" />
</client>
<services>
<service behaviorConfiguration="MemberDocuments.ServiceBehavior"
name="Kinecta.BusinessServices.MemberDocuments.BLSMemberDocuments">
<endpoint address="BLSMemberDocumentsREST"
binding="webHttpBinding"
behaviorConfiguration="restBehavior"
contract="Kinecta.PublicServiceContracts.IBLSMemberDocuments">
</endpoint>
<endpoint address="BLSMemberDocumentsSOAP"
binding="basicHttpBinding"
behaviorConfiguration="soapBehavior"
contract="Kinecta.PublicServiceContracts.IBLSMemberDocuments">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MemberDocuments.ServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="restBehavior">
<webHttp faultExceptionEnabled="true" />
</behavior>
<behavior name="soapBehavior">
</behavior>
</endpointBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpBinding" scheme="http" />
<add binding="webHttpBinding" scheme="http"/>
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
<handlers>
<add name="UrlRoutingHandler"
preCondition="integratedMode"
verb="*" path="UrlRouting.axd"
type="System.Web.HttpForbiddenHandler,
System.Web, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<directoryBrowse enabled="true"/>
</system.webServer>
一些问题:1)您是否尝试运行HTTP?2) 是否可以使用IIS express(本地主机)在VS中运行服务?3) 您是否检查了SSL证书?4) 没有更改防火墙设置?我们当前正在通过http运行,并且该服务正在我的本地IIS(7.5)而不是IIS express下运行。我在WCF测试客户端中注意到的一件事是,周二生成的信息和配置与今天完全不同。我可能受到我最近的一个错误的“影响”,但是否可能错误不在你这边?有人改变了数据库、网络等中的某些东西?最糟糕的情况是,如果代码很小,那么可能值得尝试将其全部粘贴到新的Visual Studio项目中?老实说,除了我之外,没有其他人接触过此代码或任何片段。在服务端(即service.svc项目端),没有任何变化。我们对所有实际业务逻辑使用单独的类/项目,并保留服务部分。我希望我能说有人弄乱了什么东西,但在这一点上没有人。一些问题:1)你试过运行HTTP吗?2) 是否可以使用IIS express(本地主机)在VS中运行服务?3) 您是否检查了SSL证书?4) 没有更改防火墙设置?我们当前正在通过http运行,并且该服务正在我的本地IIS(7.5)而不是IIS express下运行。我在WCF测试客户端中注意到的一件事是,周二生成的信息和配置与今天完全不同。我可能受到我最近的一个错误的“影响”,但是否可能错误不在你这边?有人改变了数据库、网络等中的某些东西?最糟糕的情况是,如果代码很小,那么可能值得尝试将其全部粘贴到新的Visual Studio项目中?老实说,除了我之外,没有其他人接触过此代码或任何片段。在服务端(即service.svc项目端),没有任何变化。我们对所有实际业务逻辑使用单独的类/项目,并保留服务部分。我希望我能说有人搞砸了什么,但在这一点上没有人。