Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
托管在IIS地址下的wcf服务_Wcf_Iis 7 - Fatal编程技术网

托管在IIS地址下的wcf服务

托管在IIS地址下的wcf服务,wcf,iis-7,Wcf,Iis 7,我有一个托管在IIS下的WCF服务。 我有以下配置: <services> <service name="BillboardServices.LoginService" behaviorConfiguration="LoginServiceBehavior"> <host> <baseAddresses> <add baseAddress="http://myip/Log

我有一个托管在IIS下的WCF服务。 我有以下配置:

<services>
      <service name="BillboardServices.LoginService" behaviorConfiguration="LoginServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://myip/LoginService/" />
          </baseAddresses>
        </host>
        <endpoint address="" name="LoginService" binding="basicHttpBinding" contract="BillboardServices.ILoginService" />
          <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
      </service>

,我有一个404。
如果输入,则获取服务元数据

为了通过nice url访问服务,我需要对配置进行哪些更改


谢谢。

为了获得无扩展服务,您需要在global.asax文件中使用WCF 4并初始化路由引擎,如下所示:

void Application_Start(object sender, EventArgs e)
    {
        RegisterRoutes();
    }

    private void RegisterRoutes()
    {
        // Edit the base address of Service1 by replacing the "Service1" string below
        RouteTable.Routes.Add(new ServiceRoute("Service1", new WebServiceHostFactory(), typeof(Service1)));
    }

您确定省略服务部分是明智的还是有用的?我只能看到版本控制和升级的问题。@Henk-这不是WCF服务的常见做法吗?