偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

對(duì)WCF客戶端解釋說(shuō)明

開發(fā) 后端
使用WCF客戶端,開發(fā)人員可以隨意的構(gòu)建跨平臺(tái)、安全、可靠和支持事務(wù)處理的企業(yè)級(jí)互聯(lián)應(yīng)用解決方案。大大的提高了工作效率。

WCF客戶端包括許多新的和改進(jìn)的用于提高工作效率的功能。IDE 還進(jìn)行了重新設(shè)計(jì),從而向開發(fā)人員提供對(duì).NET Framework 組件的直接訪問(wèn)。

[注:Method、Operation 中文都叫做「方法」,但前者是存在 OO 中的類,不存在網(wǎng)絡(luò)上;后者存在于 Service 中,公開在網(wǎng)絡(luò)上可供其他程序調(diào)用。WCF、Data Services 和 RIA Services 中公開在網(wǎng)絡(luò)上的函數(shù)和方法,都可稱作 Operation。#t#

關(guān)于這點(diǎn),小弟我查了微軟 MCTS 認(rèn)證 WCF 3.5 的官方用書 [10]、O'Reilly 的書籍 [11],都未提到如何解決,書中只提到 .NET collections 的 metadata,以 WSDL 在網(wǎng)絡(luò)上傳輸時(shí),會(huì)以「數(shù)組 (array)」的格式呈現(xiàn)。

Because .NET collections are .NET-specific, WCF cannot expose them in the service metadata, yet because they are so useful, WCF offers dedicated marshaling rules for collections.

Whenever you define a service operation that uses the collection interfaces IEnumerable<T>, IList<T>, or ICollection<T>, the specific collection-type information gets lost in the metadata (WSDL) export, so in terms of how collection types are sent across the wire, they all are represented as arrays, the resulting metadata always uses an array.

開發(fā)WCF客戶端 時(shí),若 VS 2008 都用默認(rèn)配置,則當(dāng) WCF 的服務(wù)器端函數(shù) (Operation) 的返回類型為 List<string> 時(shí),實(shí)際返回的類型為 string[] 數(shù)組,因此客戶端若仍用 List<string> 的變量去接收和賦值時(shí),在編譯時(shí)期,即會(huì)發(fā)生下圖 1 的轉(zhuǎn)型錯(cuò)誤:

WCF 客戶端程序「添加服務(wù)引用 (Add Service Reference)」的設(shè)置即可處理此種需求。做法如下:

請(qǐng)參閱本帖。當(dāng)我們的WCF客戶端程序,要引用網(wǎng)絡(luò)上既有的 WCF 服務(wù)契約時(shí),我們會(huì)如下圖 2 般,添加一個(gè) service proxy reference。

 


責(zé)任編輯:chenqingxiang 來(lái)源: 計(jì)世網(wǎng)
相關(guān)推薦

2009-11-05 13:00:25

WCF客戶端

2009-12-22 18:18:11

WCF客戶端編程

2009-12-22 10:29:59

WCF客戶端處理

2009-12-08 16:47:06

WCF IP

2010-02-25 16:20:02

WCF客戶端

2009-12-08 16:15:13

WCF服務(wù)

2009-12-07 17:46:52

WCF框架

2009-11-09 15:49:01

WCF異步調(diào)用

2010-02-22 11:10:17

WCF獲取客戶端IP

2009-11-05 13:08:44

WCF客戶端配置

2009-12-21 15:53:56

WCF獲取客戶端IP

2010-02-24 16:39:27

WCF客戶端處理

2010-02-23 09:58:21

WCF客戶端驗(yàn)證

2011-09-09 09:44:23

WCF

2009-12-07 17:28:55

WCF數(shù)據(jù)

2009-12-08 09:33:53

WCF服務(wù)

2010-02-23 15:12:25

WCF客戶端

2010-02-24 16:17:09

WCF獲取客戶端IP

2009-12-21 10:19:05

Silverlight

2009-12-21 10:09:26

WCF創(chuàng)建客戶端服務(wù)對(duì)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)