This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy


■ I N T R O D U C I N G  W I N D O W S   C O M M U N I C AT I O N   F O U N D AT I O N 896



Download 21,46 Mb.
Pdf ko'rish
bet1717/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   1713   1714   1715   1716   1717   1718   1719   1720   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

I N T R O D U C I N G  W I N D O W S   C O M M U N I C AT I O N   F O U N D AT I O N



896

8849CH25.qxd  10/16/07  10:51 AM  Page 896




If you open the myProxy.cs file, you will find a client-side representation of the IEightBall

interface, as well as a new class named EightBallClient, which is the proxy class itself. This class

derives from the generic class, System.ServiceModel.ClientBase, where T is the registered serv-

ice interface. 

In addition to a number of custom constructors, each method adorned with the

[OperationContract] attribute will be implemented to delegate to the parent class’s Channels

property to invoke the correct external method. Here is a partial snapshot of the proxy type:

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]

public partial class EightBallClient : 

System.ServiceModel.ClientBase, IEightBall

{

...



public string ObtainAnswerToQuestion(string userQuestion)

{

return base.Channel.ObtainAnswerToQuestion(userQuestion);



}

}

When you create an instance of the proxy type, the base class will establish a connection to the



endpoint using the settings specified in the client-side application configuration file. Much like the

server-side configuration file, the generated client-side App.config file contains an 

element and details regarding the basicHttpBinding used to communicate with the service. 

In addition, you will find the following  element, which (once again) establishes the

ABCs from the client’s perspective: 



address="http://localhost:8080/MagicEightBallService"

binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IEightBall"

contract="ServiceReference.IEightBall" name="BasicHttpBinding_IEightBall" />



At this point, you could include these two files into a client project (and reference the System.

ServiceModel.dll assembly) and use the proxy type to communicate with the remote WCF service.

However, rather than doing so, let’s see how Visual Studio can help to further automate the creation

of client-side proxy files. 


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   1713   1714   1715   1716   1717   1718   1719   1720   ...   1830




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2025
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish