【发布时间】:2011-09-19 16:58:02
【问题描述】:
我有 WCF 服务:
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/ClientA
https://myservice/service.svc/ClientB
https://myservice/service.svc/ClientC
以下链接有效,但我不认为这是由于我的配置,好像我在最后一个正斜杠之后写了任何东西它仍然有效....
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 !!!)
请告诉我如何实现这一点。我不想为所有客户创建单独的服务。
【问题讨论】:
-
对不起,但我真的坚持这个,我需要一些答案,我的主题问题在问题的海洋中得到了回答,所以再问一次,如果你可以删除最后一个(或者如果你可以告诉我怎么做)..我很乐意删除那个..但是请让它活着......我需要一些出路......