zoukankan      html  css  js  c++  java
  • Activation URLs II

    Activation URLs

    Server-activated objects that are published at a URL outside the application domain are called well-known types. Therefore, the URL is called the well-known object URL. The form of a well-known object URL is as follows:

    ProtocolScheme://ComputerName:Port/PossibleApplicationName/ObjectUri

    However, it is important to note that if you are hosting your remote object in Internet Information Services (IIS), you cannot declare an application name. In this case, the virtual directory of your application automatically becomes the application name. In addition, other minor changes might be required.

    Client-activated objects do not need a unique URL for each object, because the .NET remoting system generates a URL that is unique to each instance on your behalf. As a result, the URL used to activate a client-activated object is called a client activation URL. The form of a client activation URL is as follows:

    ProtocolScheme://ComputerName:Port/PossibleApplicationName

    If you use TcpChannel objects, the port number is required.

    With host application domains other than IIS, you can configure your remotable type programmatically or you can use a configuration file. To do the latter, you must load the values in the file by calling RemotingConfiguration.Configure and passing the name of the configuration file. (When you host a remotable type in Internet Information Services (IIS), <service> elements will be detected.) Although you can use any file name for your remoting configuration file, application security settings are only enforced if they are contained in a file that has a name in the following form:

    <ApplicationName>.<FileExtension>.config

    It is recommended that you use this file name form in most cases. For example, if your host executable is MyServer.exe, then the appropriate name for your configuration file is MyServer.exe.config.

    Whatever file names you choose, you can pass several configuration files to Configure. It is often helpful to specify channels, formatters, and providers of custom channels in a separate file or files and then register them all in successive calls to Configure. This enables you to copy configuration files that deal only with channels, or providers, or any other custom functionality. If you specify custom channel templates in a Channels.config file and custom providers in a Providers.config file, you can use the calls shown in the following code example to configure your remoting client.

     
    [C#]
    RemotingConfiguration.Configure("Providers.config");
    RemotingConfiguration.Configure("Channels.config");
    RemotingConfiguration.Configure("RemoteClient.exe.config");

    See Also

    Configuration | Remote Object Configuration | Remoting Settings Schema

  • 相关阅读:
    【转载】网站服务器运维记实:阿里云1核2G突发性能t5服务器突然变得卡顿
    【转载】C#中自定义Sort的排序规则IComparable接口
    【转载】C#将图片转换为二进制流调用
    【转载】ASP.NET MVC重写URL制作伪静态网页,URL地址以.html结尾
    Java通过反射机制修改类中的私有属性的值
    Android -- 分享功能和打开指定程序
    Java存储密码用字符数组
    java笔试题(3)
    Java中的String与常量池
    Android -- 距离感应器控制屏幕灭屏白屏
  • 原文地址:https://www.cnblogs.com/MayGarden/p/1639694.html
Copyright © 2011-2022 走看看