首页 新闻 会员 周边 捐助

wcf iis发布问题

0
悬赏园豆:20 [已关闭问题] 关闭于 2015-10-21 16:53

想请教下各位,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>
神秘代码的主页 神秘代码 | 初学一级 | 园豆:109
提问于:2015-09-11 13:10
< >
分享
所有回答(1)
0

https://msdn.microsoft.com/en-us/library/ee358760.aspx

http://gunaatita.com/Blog/URL-rewriting-in-WCF/1052

Yu | 园豆:12990 (专家六级) | 2015-09-12 08:50

我按这个方式试了,不行啊

支持(0) 反对(0) 神秘代码 | 园豆:109 (初学一级) | 2015-09-12 10:11

@神秘代码: 再好好试试,是可以的

支持(0) 反对(0) Yu | 园豆:12990 (专家六级) | 2015-09-12 10:37

@Yu: 额,试了半天还是不行啊

支持(0) 反对(0) 神秘代码 | 园豆:109 (初学一级) | 2015-09-12 11:20
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册