C# WCF多个Http/Https端点问题
可能重复: 我有WCF服务:C# WCF多个Http/Https端点问题,c#,asp.net,wcf,iis,C#,Asp.net,Wcf,Iis,可能重复: 我有WCF服务: https://myservice/service.svc https://myservice/service.svc?wsdl 以下是我的WCF应用程序的web.config的相关部分,如果您需要更多信息,请告诉我: <bindings> <basicHttpBinding> <binding name="basicHttp"> <security mode="TransportWithMessageCred
https://myservice/service.svc
https://myservice/service.svc?wsdl
以下是我的WCF应用程序的web.config的相关部分,如果您需要更多信息,请告诉我:
<bindings>
<basicHttpBinding>
<binding name="basicHttp">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MyService.ServiceBehavior">
<serviceMetadata httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="MembershipProvider" membershipProviderName="SqlMembershipProvider"/>
</serviceCredentials>
<serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="100" maxConcurrentSessions="100"></serviceThrottling>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="MyService.ServiceBehavior" name="MyService.Service">
<endpoint address="/ClientA" binding="basicHttpBinding" bindingConfiguration="basicHttp" name="basicHttpEndpoint" contract="MyService.IService"></endpoint>
<endpoint address="/ClientB" binding="basicHttpBinding" bindingConfiguration="basicHttp" name="basicHttpEndpoint" contract="MyService.IService"></endpoint>
<endpoint address="/ClientC" binding="basicHttpBinding" bindingConfiguration="basicHttp" name="basicHttpEndpoint" contract="MyService.IService"></endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
下面的链接可以工作,但我不认为这是由于我的配置,好像我在最后一个正斜杠之后写了什么,它仍然可以工作
https://myservice/service.svc?wsdl/ClientA
https://myservice/service.svc?wsdl/ClientB
https://myservice/service.svc?wsdl/ClientC
https://myservice/service.svc?wsdl/asfgvafgfgf ... (this works too !!!)
请让我知道如何做到这一点。我不想为所有客户端创建单独的服务。尝试将“/”从端点地址中去掉,就像mex端点地址一样。地址采用相对路径 在我的机器上的一个示例应用程序中,url看起来像
http://localhost:56988/Service1.svc?ClientA
那样做了,也没用。。。。告诉我一件事,如果删除“/”以测试它是否工作,我应该在浏览器中键入什么???我试过了,没用!!!尝试它仍然会工作…很抱歉,但我真的被这个卡住了,我需要一些答案,我的线程问题被留在了问题的海洋中,所以再次问它,如果你能删除最后一个,或者如果你能告诉我怎么做。。我很乐意删除那个。。。。但请让这个活下去。。。我需要一些出路。。。
http://localhost:56988/Service1.svc?ClientA