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


Establishing the ABCs Within an App.config File



Download 21,46 Mb.
Pdf ko'rish
bet1706/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   1702   1703   1704   1705   1706   1707   1708   1709   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

Establishing the ABCs Within an App.config File

When you are building a host for a WCF service type, you will follow a very predictable set of steps—

some via configuration and some via code:

1.

Define the endpoint for the WCF service being hosted within the host’s configuration file. 



2.

Programmatically make use of the ServiceHost type to expose the service types available

from this endpoint.

3.

Ensure the host remains running to service incoming client requests. Obviously, this step is

not required if you are hosting your service types using a Windows service or IIS.

In the world of WCF, the term “endpoint” simply represents the address, binding, and contract

rolled together in a nice tidy package. In XML, an endpoint is expressed using the 

element and the address, binding, and contract elements. Update your *.config file to specify a

single endpoint (reachable via port 8080) exposed by this host:











binding="basicHttpBinding"

contract="MagicEightBallServiceLib.IEightBall"/>







Notice that the  element is the root for all of a host’s WCF settings. Each

service exposed by the host is represented by a  element, wrapped within the 

base element. Here, our single  element makes use of the (optional) name attribute to spec-

ify the friendly name of the service type. 

The nested  element handles the task of defining the address, the binding model

(basicHttpBinding in this example), and the fully qualified name of the interface type defining the

WCF service contract (IEightBall). Because we are using an HTTP-based binding, we make use of

the http:// scheme, specifying an arbitrary port ID. 


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   1702   1703   1704   1705   1706   1707   1708   1709   ...   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