国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

客戶端調用第三方remoting 服務程序的n中方式,VB.NET 晚期邦定還真方便

2024-07-10 13:01:01
字體:
來源:轉載
供稿:網友
寫一個簡單的remoting 服務程序,helloworld:)

類函數:


public class simpleobjectclass simpleobject
inherits system.marshalbyrefobject

public function helloworld()function helloworld(byval message as string) as string
return "hello world" & message
end function

end class
host 程序代碼
imports system.runtime.remoting.channels
imports system.runtime.remoting.remotingconfiguration
public class hostclass host
public shared sub main()sub main()
dim channel as new http.httpserverchannel(6363)
channelservices.registerchannel(channel)
registerwellknownservicetype(gettype(objectlib.simpleobject), "simpleobject", runtime.remoting.wellknownobjectmode.singlecall)
console.writeline("started ok")
console.readline()
end sub
end class


下面討論幾種調用方式

1.可客戶端不支持或者沒有安裝.net framework 的情況。

本質上remoting 服務端和客戶端走的是soap協議,對于簡單的方法。只要客戶端能支持soap就可以了。微軟提供了一個soaptoolkit ,比如在vb6 中調用我的remoting 服務。
dim o as new soapclient30
o.mssoapinit "http://server:6363/simpleobject?wsdl"
msgbox o.helloworld("montaque")

2. 在vb.net 中調用remoting 服務。通過bindingtomoniker

dim o as object = system.runtime.interopservices.marshal.bindtomoniker("soap:wsdl=http://localhost:6363/simpleobject?wsdl")
msgbox(o.helloworld("asdf")) 當然要設置option explicit off

上述代碼好像無法翻譯成c#

3。常規的方式,忽略。。。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 台北市| 三穗县| 建昌县| 伊宁市| 伊川县| 台北市| 新田县| 磐安县| 牙克石市| 宝鸡市| 虎林市| 陆河县| 毕节市| 民丰县| 松江区| 鄄城县| 玉林市| 临西县| 香格里拉县| 垦利县| 聊城市| 霸州市| 岚皋县| 邢台县| 东城区| 玛曲县| 乌兰县| 古交市| 隆回县| 固镇县| 寿光市| 修武县| 昌邑市| 云和县| 大田县| 克拉玛依市| 锦州市| 酒泉市| 杭锦旗| 贺州市| 韩城市|