博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WCFHost多个Service config
阅读量:5058 次
发布时间:2019-06-12

本文共 2086 字,大约阅读时间需要 6 分钟。

<?xml version="1.0" encoding="utf-8" ?>

<configuration>
  <system.serviceModel>
    <services>
      <service name ="CarManagementService.CarManagementImplementation" behaviorConfiguration="ExposeMetaDataBehavior">
        <endpoint
           address=""
           binding="wsHttpBinding"
           bindingConfiguration="AllowBigMessageSize"
           contract="CarManagementInterface.ICarManagement"
          />
      </service>

      <service name ="CustomerService.CustomerImplementation">

        <endpoint
           address=""
           binding="wsHttpBinding"
          
           contract="CustomerInterface.ICustomer"
          />
      </service>

      <service name ="RentalService.RentalImplementation">

        <endpoint
           address=""
           binding="wsHttpBinding"
           contract="RentalInterface.IRental"
          />
      </service>

      <service name ="ExternalInterfaceFacade.ExternalInterfaceFacadeImplementation">

        <endpoint
           address=""
           binding="wsHttpBinding"
           contract="ExtenalInterface.IExtenalInterface"
          />
      </service>
    </services>

    <behaviors>

      <serviceBehaviors>
        <behavior name="ExposeMetaDataBehavior">
          <serviceMetadata httpGetUrl="" httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <bindings>

      <wsHttpBinding>
        <binding name="AllowBigMessageSize" maxReceivedMessageSize="999999" >
        </binding>
      </wsHttpBinding>
    </bindings>
  </system.serviceModel>
</configuration>

--------------------------

static ServiceHost CarManagementServiceHost;

        static ServiceHost CustomerServiceHost;
        static ServiceHost RentalServiceHost;
        static ServiceHost ExtentalServiceHost;
        static void Main(string[] args)
        {
            CarManagementServiceHost = new ServiceHost(typeof(CarManagementService.CarManagementImplementation));
            CarManagementServiceHost.Open();

            CustomerServiceHost = new ServiceHost(typeof(CustomerService.CustomerImplementation));

            CustomerServiceHost.Open();

            RentalServiceHost = new ServiceHost(typeof(RentalService.RentalImplementation));

            RentalServiceHost.Open();

            ExtentalServiceHost = new ServiceHost(typeof(ExternalInterfaceFacade.ExternalInterfaceFacadeImplementation));

            ExtentalServiceHost.Open();

            Console.WriteLine("服务已经启动...");

            Console.ReadKey();
        }

转载于:https://www.cnblogs.com/feidaochuanqing/p/3361356.html

你可能感兴趣的文章
【ul开发攻略】HTML5/CSS3菜单代码 阴影+发光+圆角
查看>>
虚拟中没有eth0
查看>>
Unity 3D游戏开发学习路线(方法篇)
查看>>
BZOJ2049[Sdoi2008]Cave 洞穴勘测(LCT模板)
查看>>
vuex插件
查看>>
网络__笔记_TCP/IP详解___第一章
查看>>
屏幕绘图最佳利器Pointfix,绿色中文版
查看>>
2011年12月09日
查看>>
[ZJOI2007]棋盘制作 【最大同色矩形】
查看>>
合并单元格
查看>>
swift-初探webView与JS交互
查看>>
IOS-图片操作集合
查看>>
Android bitmap图片处理
查看>>
Android应用程序进程启动过程的源代码分析
查看>>
adb logcat 命令行用法
查看>>
Redis学习手册(Key操作命令)
查看>>
模板统计LA 4670 Dominating Patterns
查看>>
文件内容红帽子数据库.profile文件内容详解
查看>>
泛型第23条:请不要在新代码中使用原生态类型
查看>>
对象方法(转载)Java中finalize的使用
查看>>