国产探花免费观看_亚洲丰满少妇自慰呻吟_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。常規的方式,忽略。。。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 庆安县| 双桥区| 长宁区| 盐山县| 元阳县| 玉山县| 天峨县| 阿图什市| 桂平市| 六枝特区| 盐池县| 加查县| 潢川县| 抚远县| 英吉沙县| 临沂市| 江孜县| 大名县| 马山县| 清水河县| 博罗县| 晋州市| 沙雅县| 新平| 斗六市| 呼伦贝尔市| 佛坪县| 无锡市| 太和县| 神农架林区| 崇阳县| 内江市| 永川市| 梅河口市| 内丘县| 祁阳县| 西畴县| 泽普县| 绵阳市| 平顶山市| 浮山县|