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 870



Download 21,46 Mb.
Pdf ko'rish
bet1668/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   1664   1665   1666   1667   1668   1669   1670   1671   ...   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



870

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




Figure 25-1.

XML web services allow for a very high degree of interoperability.

By way of a quick example, assume you have authored the following programming logic in a

new file named HelloWebService.asmx (*.asmx is the default file extension for a .NET XML web serv-

ice file). Once you have done so, save it into C:\HelloWebService.



<%@ WebService Language="C#" %>

using System;

using System.Web.Services;

public class HelloWebService

{

[WebMethod]



public string HelloWorld()

{

return "Hello World";



}

}

While this simple service is hardly doing anything terribly useful, notice that the file opens with



the WebService directive, which is used to specify which .NET programming language is used in the

file, and the name of the class type representing the service. Beyond this, the only point of interest is

that the HelloWorld() method has been decorated with the [WebMethod] attribute. In many cases,

this is all you need to do to expose a method to external callers via HTTP. Finally, notice that you do

not need to do anything special to encode the return value into XML, as this is done automatically

by the runtime. 

If you wish to test this web service, simply open up a Visual Studio 2008 command prompt and

enter the following command (if you’d like to see each option you can use with this development

web server, simply enter the -? argument):

webdev.webserver /port:8080 /path:"C:\HelloWebService"

C H A P T E R   2 5  


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   1664   1665   1666   1667   1668   1669   1670   1671   ...   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