想请教下各位,wcf发布到iis,发布后的地址是以.svc结束的,我想请问下,如何配置才能去掉.svc,用我终结点中设置好的地址。以下是我配置文件信息:
<system.serviceModel> <services> <service name="WcfService1.Service1"> <host> <baseAddresses> <add baseAddress = "http://localhost:8732/MyAdress" /> </baseAddresses> </host> <!-- Service Endpoints --> <!-- Unless fully qualified, address is relative to base address supplied above --> <endpoint address ="" binding="wsHttpBinding" contract="WcfService1.IService1"> <!-- Upon deployment, the following identity element should be removed or replaced to reflect the identity under which the deployed service runs. If removed, WCF will infer an appropriate identity automatically. --> <identity> <dns value="localhost"/> </identity> </endpoint> <!-- Metadata Endpoints --> <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> <!-- This endpoint does not use a secure binding and should be secured or removed before deployment --> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="false" /> </system.serviceModel>
https://msdn.microsoft.com/en-us/library/ee358760.aspx
http://gunaatita.com/Blog/URL-rewriting-in-WCF/1052
我按这个方式试了,不行啊
@神秘代码: 再好好试试,是可以的
@Yu: 额,试了半天还是不行啊