麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 編程 > .NET > 正文

Using Web Services for Remoting over the Internet.

2024-07-21 02:21:48
字體:
來源:轉載
供稿:網友
introduction
this article describes a design and implementation (c#) of the remoting over internet using the web service as a gateway into the remoting infrastructure. the web service gateway (custom remoting channel) allows to enhance the remoting channel over internet and its chaining with another heterogeneous channel. consuming a remote object over internet is full transparently and it doesn't require any special implementation from the remoting via intranet. the web service gateway enables to create a logical model of the connectivity between the different platforms and  languages. before than we will go to its implementation details, let's start it with usage and configuration issue. for some demonstration purpose i will use a msmq custom remoting channel (msmqchannellib.dll), which i described in my previously article [][1]#[1]]1]. i am assuming that you have a knowledge of the .net remoting and web service.
usage
consuming a remote object over internet using the web service gateway is very straightforward and it actually requires only to install the following assemblies:
  • webservicechannellib , this is a custom remoting channel on the client side to forward a remoting message to the web service gateway over internet (outgoing message).
  • webservicelistener, this is a web service (gateway) to listen an incoming message from the client side and forward it to the local remoting infrastructure (incoming message).

note that the above assemblies have to be installed (into the gac) both on the server and client sides when a remote callback is used.  
the next step is to configure a server and client host sides. their configuration are depended from the actually application. let me assume, we want to call a remote object driven by msmq custom channel over internet. their config files might look like the following snippets:
server.exe.config
<configuration>
<system.runtime.remoting>
  <application >
   <service>
    <wellknown mode="singleton" type="myremoteobject.remoteobject, myremoteobject"
               objecturi="endpoint" />
   </service>
   <channels>
   <channel type="rkiss.msmqchannellib.msmqreceiver, msmqchannellib"
            listener="./reqchannel"/>
   <channel type="system.runtime.remoting.channels.tcp.tcpchannel, system.runtime.remoting"
            port="8090" />
   </channels>
  </application>
</system.runtime.remoting>
</configuration>
the above server config file will register two channels to listen an incoming message for the remote well known singleton object.
client.exe.config
this is an example of the client config file to register our custom remoting channel.
<configuration>
<system.runtime.remoting>
  <application>
   <client >
    <wellknown type="myremoteobject.remoteobject, remoteobject"
               url="ws://localhost/webservicelistener/listener.asmx;
               tcp://localhost:8090/endpoint/remoteobject" />
   </client>
   <channels>
    <channel type="rkiss.webservicechannellib.sender, webservicechannellib" mode="soap"/>
   </channels>
  </application>
</system.runtime.remoting>
</configuration>
the ws is a custom remoting client channel to dispatch an imessage over internet using a binary respectively soap mode formatter. note that the mode is a customchannelproperty and its default value is binary.
web.config
this is a web service config file. the following snippet is its part. the web service gateway is also a local remoting client, therefore a client (sender) channel is requested to be registered. the following snippet shows a configuration of the two channels - tcp and msmq.
<system.runtime.remoting>
<application >
  <channels>
   <channel type="system.runtime.remoting.channels.tcp.tcpchannel, system.runtime.remoting"/>
   <channel type="rkiss.msmqchannellib.msmqsender, msmqchannellib"                  
            respond="./rspchannel" admin="./adminchannel" timeout="30" priority="10"/>
  </channels>
</application>
</system.runtime.remoting>
activating a remote object
the well known remote object (wko) is activated by its consumer using the getobject method mechanism. the proxy is created based on the remote object metadata assembly installed in the gac (see an argument objecttype). the remoting channel is selected by the objecturl argument. the url address in this solution has two parts :
  • connectivity to the web service gateway over internet
  • connectivity to the remote object over intranet within the web service gateway

between the primary and secondary addresses is a semicolon delimiter as it is shown the below:
string objecturl = @"ws://localhost/webservicelistener/listener.asmx; msmq://./reqchannel/endpoint";
using this objecturl design pattern allows an easy selection of the web service gateways on the internet. note that the ws custom remoting channel will trim this primary address and forward only its secondary part. in this solution, the objecturl represents a physical path of the logical connectivity between the consumer and remote object regardless of how many channels are needed. in this example, the web service gateway resides on the localhost and it should be replaced by the real machine name.
finally, the following code snippet shows an activation of the remote object:
// activate a remote object
type objecttype = typeof(myremoteobject.remoteobject);
string objecturl = @"ws://localhost/webservicelistener/listener.asmx; msmq://./reqchannel/endpoint";
remoteobject ro = (remoteobject)activator.getobject(objecttype, objecturl);
note that a metadata (assembly) of the remote object must be installed into the gac in the places such as client, web service gateway and server host.
that's all for the client/remoteobject plumbing issue over the internet.
the following pictures shows this connectivity:


    
now, to understand how the message flows between the heterogeneous channels over the internet, have a look at the following paragraphs:
 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 神马久久蜜桃 | 国产91九色视频 | 怦然心动50免费完整版 | av电影在线播放 | 亚洲无马在线观看 | 毛片a级毛片免费播放100 | 91精品国产乱码久久久久久久久 | 久久情爱网 | 草莓视频久久 | 中国7777高潮网站 | 美女视频网站黄色 | 精品久久9999 | 欧美一级爱爱 | 久久久青| 欧美日韩精品一区二区三区不卡 | 欧美黄 片免费观看 | 一区二区三区视频在线播放 | 日本在线免费观看视频 | 欧美日在线观看 | 久久千人斩 | 日本a∨精品中文字幕在线 被啪羞羞视频在线观看 | 91成人天堂久久成人 | 国产精彩视频在线 | 禁漫天堂久久久久久久久久 | 日本中文一级片 | 久草在线视频精品 | 韩国一大片a毛片 | 黄网站免费观看视频 | 欧美一级做一a做片性视频 日韩黄色片免费看 | 久久国产精品系列 | 猫咪av在线 | 久久精品视频1 | 一级毛片在线免费观看 | 久久久婷婷一区二区三区不卡 | 国产精品一区二区三区在线播放 | 91av亚洲| 欧美一级片免费在线观看 | 天海翼无删减av三级在线观看 | 欧美精品欧美极品欧美激情 | 黄色毛片视频在线观看 | 国产精品久久久久久久久久三级 |