Web Services with ASP.NET - PowerPoint PPT Presentation

About This Presentation
Title:

Web Services with ASP.NET

Description:

... WSDL UDDI Web ... Discovery of Web Services) ... – PowerPoint PPT presentation

Number of Views:203
Avg rating:3.0/5.0
Slides: 77
Provided by: Svet52
Category:
Tags: asp | net | discovery | services | uddi | using | web

less

Transcript and Presenter's Notes

Title: Web Services with ASP.NET


1
(No Transcript)
2
Web ??????? ASP.NET
???????????? ?? .NET Framework
http//www.nakov.com/dotnet/
??????? ?????
?????????? ???????? ?? ?????????? ?? ???????
academy.devbg.org
3
?????????? ??????
  • ?????? ???????? ?? .NET Framework
  • ?????? ???????? ?? ????? C
  • ?????? ???????? ?? ASP.NET
  • ??????? ?????? ?? ?????? ? Visual Studio .NET
  • ???????? ?? XML
  • ????????

4
??????????
  • ???????????????? ?? Web ????????
  • ???????????? ??????????
  • ??????? ?? Web ??????
  • ?????? ? Web ??????
  • UDDI ?????????? ?? Web ??????
  • ????????? ?? Web ?????? (DISCO)
  • WSDL ???????? ?? ??????
  • SOAP ?????? ?? ????????
  • ?????????? ???? ?? Web ????????
  • ???????? ?? ?????????? ?? Web ??????
  • .NET Enterprise ??????????

5
?????????? (2)
  • Web ???????? ? ASP.NET
  • ???????????
  • ????????? ?? Web ??????
  • ??????????? ?? Web ??????
  • ?????????? ?? Web ??????. ?????????? ?? ??????
    ????
  • Web ???????? ? VS.NET ????????? ? ???????????
  • ???????? ?? Web ???????? WebService,
    WebMethod
  • ??????????? ?? ??????

6
?????????? (3)
  • Web ???????? ? ASP.NET
  • Deployment ?? Web ?????? ????? IIS
  • ????????? ?? Web ??????
  • ??????? ?? ?????????? ?? Web ???????? ? ASP.NET
  • ?????????? ?????????
  • Web ?????? ? ?????? ? ?????
  • ????????? ?? ?????
  • ????????? ?? Web ????????
  • ????????? ???? ?????
  • ???????????? ? Web ????????

7
???????????? ??????????
  • ???????? ?????? ?????????? ?? ????????????
  • ??????? ?? ?? ??????? ??????????? ??????????,
    ????? ?? ??????????????
  • ?????? ?? ???????????? ??????????
  • ????? "??????/??????"
  • ????? "???????????? ??????"
  • DCOM ?????? ?? ? Microsoft Windows
  • CORBA ??????? ????????, ????? ??????
  • Java RMI ?????? ?? ?? Java ????????????
  • .NET Remoting ?????? ?? ? .NET Framework
  • ????? "Web ??????"

8
??????? ?? Web ??????
  • ??????? "???????????? ?????? ?? ? ???????? ??
    ???????? ? ????????
  • ????? ?????????? ????? ?????? ? ??????
  • ????????? ??? ??????????? ??????????????
  • ???????? ? ????????
  • ????????? ????? (firewalls) ????? ???????????
    ?????????????
  • COM/DCOM ?? ???????? ???? ? Windows
  • CORBA ?? ?????? ????? ???? ????????
  • Java RMI / EJB ?? ????????? ???? ? Java
  • ????????? Web ??????

9
????? ? ???????
  • ? ??????? ???? ???????? ?
  • ??????? ??????, ?????????? ?? ????????? ?? ??????
  • ?????????? ??????? ????? ???????? ?? ???????
    (?????????? ?? ??????)
  • ? ???? ?????????? ?????? ????????? ? ???????
    ?????????
  • ????? ?? ??????????
  • ?????? ????????
  • ??? ?????????????? ?? ???????? (????, ????? ??
    ?????????? ? ??.)

10
Web-??????
  • Web-???????? ????????? ???????? ?? ??????? ????
  • ????????? ??????????, ???????? ?????????? ????
    Web
  • ????? ?? ?????????? ??????-???????
  • ???????? ???????, ???????? ????????? ????????? ?
    ????? ????????
  • ????????? ???????? ????????? ?? ???????????
    HTTP, XML ? SOAP
  • ???? ??????? ?????????? ?? ?? ?????? ???? ?????
    WSDL
  • ????? ?? ????? ??????? ???? UDDI

11
Web-??????
  • Web-???????? ????????? ???????? ?? ??????? ????
  • ??????? ?? ???????? ?? ?????? ?? SOAP ?????????
  • ??????????? ???????? ????????????? ??????????
    ????? ????????? (???????? ?? ???????)
  • ?????????? ?? ????????????? ???????, ???????????
    ? ????? ?? ????????????
  • ????????????-?????????? (loosely coupled)
  • ?????-????????? ? ???????

12
????????????????
  • ???????????????? ?? Web ???????? ?? ?????? ??
    ???????? ??????????
  • ?????????? (Directory)
  • UDDI
  • ????????? (Discovery)
  • DISCO
  • ???????? (Description)
  • WSDL
  • ?????? ?? ???????? (Wire Format)
  • SOAP
  • XML, XSD, HTTP

13
?????????? ?? Web ??????
  • ???????????? ?? Web ??????
  • ?????????? ??????? ?? Web ??????
  • ???????????? ?? ?? ?????????
  • ???? ?? ?? ????? ?? ???????? ?????????
  • ????????? UDDI ?????????
  • UDDI (Universal Description, Discovery and
    Integration)
  • ??????? ???????? ?? OASIS
  • ???????????? Web ??????, ?????????? ??????????? ?
    ??????? ?? ????? Web ??????
  • ?????? ?? UDDI ??????????
  • http//uddi.microsoft.com

14
?????????? ??????
15
????????? ?? Web ??????
  • ??????????? ?? Web ??????
  • ????????? ?? ?? ??????? ?????????? ?? Web ??????
    ?? ????? ??????
  • ????????? ?? ?. ???. "discovery" ???????
    (.disco)
  • DISCO (Discovery of Web Services)
  • XML ??????? ????
  • ?????? Web ???????? ?????? ??? WSDL ?????,
    ?????? ??? ?????? ?????? ? ?????? ???
    ???????????? ?? ????????
  • ?????????? disco ?????? ???? ? ????????
    ?????????? ?? ????????
  • ????. http//www.mysite.com/math/math.disco

16
DISCO ??????? ??????
lt?xml version"1.0" encoding"utf-8"?gt ltdiscovery
xmlns"http//schemas.xmlsoap.org/disco/"gt
ltcontractRef ref"http//www.myserver.com/De
mo-5-Service-Types/TypesService.asmx?wsdl"
docRef"http//www.myserver.com/Demo-5-Service-Typ
es/TypesService.asmx" xmlns"http//schemas.
xmlsoap.org/disco/scl/" /gt ltsoap
address"http//www.myserver.com/Demo-5-Service-Ty
pes/TypesService.asmx" xmlnsq1"http//www.my
server.com/schemas/ Demo_5_Service_Types/"
binding"q1TypesServiceSoap"
xmlns"http//schemas.xmlsoap.org/disco/soap/"
/gt lt/discoverygt
17
WSDL ???????? ?? ??????
  • WSDL (Web Services Description Language)
  • ?????? ?????????? ?? ?????? ?? ?????? Web ??????
  • ??????? ?? ???????????? ??????
  • ?????? ? ??????? ?????????
  • ?????????? ?????? ?????
  • XML ??????? ??????? ???????? ?? W3C
  • ASP.NET Web ???????? ?????? ???? WSDL ???
    ????????? ? ????????? ?wsdl
  • http//localhost/MyService.asmx?wsdl

18
WSDL ???????? ??????
lt?xml version"1.0" encoding"utf-8"?gt ltdefinition
s xmlnshttp"http//schemas.xmlsoap.org/wsdl/htt
p/" xmlnssoap"http//schemas.xmlsoap.org/wsdl/s
oap/" xmlnss"http//www.w3.org/2001/XMLSchema"
xmlnss0"http//www.devbg.org/ws/MathService"
xmlnssoapenc"http//schemas.xmlsoap.org/soap/enc
oding/" xmlnstm"http//microsoft.com/wsdl/mime/
textMatching/" xmlnsmime"http//schemas.xmlsoap
.org/wsdl/mime/" targetNamespace"http//www.devb
g.org/ws/MathService" xmlns"http//schemas.xmlso
ap.org/wsdl/"gt lttypesgt lt/typesgt ltmessage
name"AddSoapIn"gt lt/messagegt ltportType
name"MathServiceSoap"gt lt/portTypegt ltbinding
name"MathServiceSoap" gt lt/bindinggt ltservice
name"MathService"gt lt/servicegt lt/definitionsgt
19
SOAP ?????? ?? ????????
  • SOAP (Simple Object Access Protocol)
  • ???????? XML ??????? ?????? ?? ?????? ??
    ?????????
  • ??????? ???????? ?? W3C
  • ???? SOAP ????????? ?? ?????? ??
  • SOAP ????? ?????? ????????? ?? ???????????
    (?????????)
  • SOAP ???? ??????? ?????? ????????? (?????
    ??????????? ??? ????????? ??????)
  • ?????????? SOAP ??????????? ?? ???????? ??
    ???????? HTTP
  • ???? ????????? ?? ?????????? ???? firewall

20
SOAP ?????? ??????
lt?xml version"1.0" encoding"utf-8"?gt ltsoapEnvel
ope xmlnsxsi"http//www.w3.org/2001/XMLSchema-
instance" xmlnsxsd"http//www.w3.org/2001/XMLS
chema" xmlnssoap"http//schemas.xmlsoap.org/so
ap/envelope/"gt ltsoapBodygt ltCalcDistance
xmlns"http//www.devbg.org/Calc"gt ltp1gt
ltxgt4lt/xgt ltygt5lt/ygt lt/p1gt
ltp2gt ltxgt7lt/xgt ltygt-3lt/ygt
lt/p2gt lt/CalcDistancegt lt/soapBodygt lt/soapEn
velopegt
21
SOAP ??????? ??????
lt?xml version"1.0" encoding"utf-8"?gt ltsoapEnve
lope xmlnsxsi"http//www.w3.org/2001/XMLSchema
-instance" xmlnsxsd"http//www.w3.org/2001/XML
Schema" xmlnssoap"http//schemas.xmlsoap.org/s
oap/envelope/"gt ltsoapBodygt
ltCalcDistanceResponse xmlns"http//www.devb
g.org/Calc/"gt ltCalcDistanceResultgt
8,54400374531753 lt/CalcDistanceResultgt
lt/CalcDistanceResponsegt lt/soapBodygt lt/soapEnv
elopegt
22
????????????????
???????? MSDN
23
?????????? ???? ?? Web ????????
?????????
SOAP
?????????
WSDL
XSD
?????
XML
?????
HTTP
?????????
24
HTTP, XML, XSD
  • HTTP
  • ???????? ?? ?????? ?? ?????????? ????? Web ??????
    ? Web ???????
  • ???????? ?????? "??????-???????"
  • ?? ???????? ?????????? ????? (stateless)
  • ??????? ???????? ?? W3C
  • XML
  • ?????, ????????-??????? ???? ?? ?????????????
    ???????? ?? ??????????
  • ??????? ???????? ?? W3C
  • XSD
  • ????? XML-??????? ???? ?? ???????? ???????????
    (???????) ?? XML ?????????
  • ??????? ???????? ?? W3C

25
???????? ?? ??????????
  • ??????? ???????? ?? ???????? ?? Web ??????
  • ?????? ??? ????????? ??????????
  • ????? ?? ?? ?????????? ???????? ?? ?????????,
    ???????? ?? MS Office
  • ?????????? ?? ??????????
  • ?????????????? ????? ??????????, ???????? ??
    ???????? ????????? ? ??
  • ?????? ????? ????????? ?????????? ??? Enterprise
    ??????????

SOAP ??????
ADO .NET
Web ??????
Front End (??????)
Back End (???? ?????)
26
Enterprise ??????????
  • ????? ?? "Enterprise ????????????"?
  • ??????????? ???????????? ??????????, ??????????
    ?? ??????? ?? ???????? ???????????? ???????
  • ????????
  • ??????????
  • ????? ??????????
  • ????????? ?? ???????
  • "Enterprise" ? buzzword ???????, ?? ????? ?????
    ?? ??????, ????? ?? ????????? ? ????, ?? ????
    ????? ????????? ????? ????????

27
.NET Enterprise ??????????
  • ???????????? Enterprise ??????????? ? ?????????

28
.NET Enterprise ??????????
  • ???????? ? ??????????? ???????????
  • ?????????????? ???? (Front End)
  • ????????? ???????????????? ? ???????????
    (????????????? ?????????)
  • Windows Forms ? ASP.NET Web ??????????
  • ?????? ???? (Business Tier)
  • ????????? ????????? ??????? ? ?????????? ???
    ??????? (?????? ????????)
  • ASP.NET Web ??????
  • ???? ?? ??????? (Back End)
  • ????????? ??????? ?? ?????????
  • ???? ?? ????? (MS SQL Server, Oracle, DB2)

29
Web ???????? ? ASP.NET
  • ?????????? ?? ? ?????????????? System.Web.Services
  • ????????????? ??????????? ? ?????????? ?? SOAP
    ?????????
  • ?????????? ????????????? ?? ???????? ?? XML ?
    .NET ?????? ? ?????????
  • ??????????? ?????????? ?? WSDL ????????
  • ??????????? ?????????? ?? C ?????? ??????? ??
    WSDL ????????

30
ASP.NET Web ?????? ???????????
  • Web ???????? ?? ??????? ? IIS (Internet
    Information Server)
  • ?????????? ?? ?? ASP.NET ???????? ??????
    (aspnet_wp)

????????? ???
ASP.NET Web ?????? WebMethod public string
Blah()
????????? (.NET / Java / PHP / Perl)
ISAPI ??????
ASP.NET ??????? ??????
IIS
Common Language Runtime
??
??????????? ??????? (Win2000, WinXP, Win2003)
31
????????? ?? Web ??????
  • ? .NET Framework ?? ????????? ?? Web ?????? ??
    ??????? .asmx ????
  • ?????? ?? ????????? ???, ???????, ?? ?????? ? Web
    ??????
  • ????????? ?? ?????? System.Web.
    Services.WebService (?? ? ????????????)
  • ????????????? ?? 1 ??? ??????? Web ??????

lt_at_ WebService Language"C" Class"SomeService"
gt
WebMethod public void SomeMethod()
32
Web-?????? ??????
33
??????????? ?? Web ??????
  • Web ???????? ?? ?????????? ?? ASP.NET ????
    Web-??????????
  • ????? ?? ?? ?????????? ????? Web-???????????? ?
    ?????????
  • Web.config ? Global.asax
  • ?????????? ?? ??????? ?? IIS (Internet
    Information Server)
  • ??????????? ?? Web ??????
  • ?????? ?? ???????????? ?? ???????? ?
    C\Inetpub\wwwroot
  • ??????? ?? Web Application ? IIS
  • ????????? ?? ???????? (??? ? ??????????)

34
???????????? 1
  • ?????? ????? Web ?????? ??????????? ? ????????

35
?????????? ?? Web ??????
  • ? .NET Framework ?? ??????????? ?? Web ?????? ??
    ????????? ?. ???. ?????? ???????
  • ?????? ?????????
  • ????????? ?? ?? WSDL ??????????? ?? Web ????????
    (http///service?wsdl)
  • ????????????? ???? ??? ?? C (VB.NET, )
  • ???????????? ???????? ?? .NET ??? SOAP ?????? ?
    SOAP ?????????? ??? .NET
  • ???????????? .NET ???????? ? XML ? ?????????
    (marshalling)

.NET ??????
SOAP ??????
??????
??????
Web ??????
36
?????????? ?? ?????? ????
  • ?????? ????????? ????? ?? ?? ????????? ?
    ??????????? wsdl
  • ??????
  • ?????????? ? ?????? ?????? AddService.cs
  • ?? ????? ????? XXX ?? ????????? 3 ?????? ?
    ??????????? ?????????
  • XXX() ?? ????????? ?????????
  • BeginXXX() ? EndXXX() ?? ?????????? ?????????

wsdl http//localhost/Demo-1-AddService/Demo-1-Add
Service.asmx?wsdl
37
?????????? ?? ?????? ????
  • ???????????? ?? ?????? ????????? ? ????
    ???????????? ???????
  • ?????????? ?? ?????? ??????
  • ???????? ?? ?? ????????
  • ???????? ????? ?? ??????????? SoapException ???
    WebException
  • ??? ??????? ?? ?????????? ?? Web ???????? ??????
    ?? ?? ???????? ?????? ?????? ??????

AddService addSevice new AddService() int sum
addService.Add(5, 6)
38
???????????? 2
  • ?????????? ?? Web ??????

39
Web ???????? ? VS.NET
  • Visual Studio .NET ??? ????? ????????? ?? Web
    ??????
  • ????????? ?? Web ??????
  • ??????????? ?? Web ??????
  • ??????????? ?????????? ?? ?????? ???? ?? WSDL
    ??????????

40
????????? ?? ?????? ? VS.NET
  • ??? ????????? ?? ???? Web-?????? VS.NET 2003
    ????? ????????
  • ??????? .sln ????
  • ??????? ????????? ?????????? ? IIS
  • ??????? ? ??? ????????? ?? ???????

C\Documents and Settings\ltyour user namegt\ My
Documents\Visual Studio Projects\ ltWebServiceNamegt
\ltWebServiceNamegt.sln
C\Inetput\wwwroot\ltWebAppNamegt
ltWebServiceNamegt.csproj, ltWebServiceNamegt.asmx,
ltWebServiceNamegt.asmx.cs, ltWebServiceNamegt.resx, W
eb.config, Global.asax, Global.asax.cs
41
???????????? 3
  • ????????? ?? Web ?????? ? VS.NET

42
???????????? 4
  • ??????????? ?? Web ?????? ? VS.NET

43
???????? ?? Web ????????
  • ????????? WebService
  • ?????? ???????? ?? Web ????????
  • Namespace ?????? XML ????????????, ?????
    ???????????? ???????? ????????
  • Name ??? ?? ????????
  • Description ???????? ???????? ?? ????????
  • ????????? WebMethod
  • ??????, ?? ????? ????? ? ???????? ?? ????????? ??
    Web ????????
  • EnableSessiontrue ????????? ?????????? ??
    ????? (Session ?????? ? ASP.NET)
  • Description ???????? ???????? ?? ??????

44
???????? ?? ???????? ??????
WebService( Description"Demo Web service
" " demonstrates complex type
marshalling.", Namespace"http//www.devbg.org
/services/" "Demo_5_Service_Types/2004/1
2/17", Name"Demo 5 - Service Types") public
class TypesService System.Web.Services.WebSe
rvice ... WebMethod(
Description"Returns the list of "
"currently active issues.",
EnableSessiontrue) public Issue
GetIssues() ...
45
??????????? ?? ??????
  • ????????????? ?? ???????? (type marshalling) ?
    .NET Framework ?? ???????? ???????????
  • ???????? ?? ?????????? XML ????????????
  • ???? ????????? ? ??????? ???????? ?? ????????
    ????? ?? ????? ??????????

??? ????????
?????????? ?????? ???????? string, char, byte, bool, sbyte, int, uint, long, ulong, short, ushort, float, double, decimal,
???????? ?????? ???????? enum Color Red, Blue ???????? ?? ???? ??????. ??????? ?? ??????? ?? ?????????? ?????????.
46
??????????? ?? ??????
  • ???? ????????? ? ??????? ???????? ?? ????????
    ????? ?? ????? ??????????

??? ????????
??????? ? ????????? ???????? ?? ???? ?????????? ?????? ? ???????? ?? ????????? ? ???????????. ????????? ?? ??????? ?????? ? ?????????? ?????????, ?? ?? ? ?????. ?????? ?? ? ????????? ??????????? ??? ?????????! ?????? ?? XML ????????????. ??????? public struct Point public int x, y public class Student public int Age get set
47
??????????? ?? ??????
  • ???? ????????? ? ??????? ???????? ?? ????????
    ????? ?? ????? ??????????

??? ????????
?????? ?????? ?? ?????????? ??????, ???????? ??????, ??????? ??? ????????? ???????? string, Color, Point
???????? ???????? ?? ?????????? ??????, ???????? ??????, ??????? ??? ?????????. ?????? ICollection, ArrayList, ???????? ?? ???? ??????.
DataSet ?????? ADO.NET DataSet ??????. ???????? ?? ?????? ? XSD ???????, ????? ?????? ??????????? ??.
XmlNode XML ?????????. ???????? ?? ? ???? ???.
48
Deployment ?? Web ??????
  • ?????? ?? ??????????? Web-?????? ?yService, ?????
    ????? ?? ????-???
  • ???????? ?????? ??????? ?? ???????? ?
    C\Inetpub\wwwroot\MyService
  • ?? IIS ????????????????? ??????? ????????? Web
    ?????????? ?? ??????????? ?????????? MyService
  • ??????????? ???????? ? VS.NET
  • ??? ???? ?? ????????? (???????? ??? Release),
    ????????? ????-????

del .cs .csproj .resx .webinfo
49
???????????? 5
  • ??????????? ?? ?????? ?????? Web ????????

50
???????????? 6
  • ??????????? ?? ?????? ?????? ?????? ?? Web
    ????????

51
???????????? 7
  • ????????? ?? Web ??????

52
??????? ?? ??????????
  • ?? ????? ?????? ??? Web ?????? ASP.NET ?????
    ????????
  • ?????????? ????? ?? Web-????????
  • ?????? ??????? ????? ?? ????
  • ????????? ???????? ? ???? ?????
  • ????? ????????? ??? ???????
  • ????? ??????? ? ??????? ????
  • ?????? ??????????? ?? ????? ?? ???????? ?? ????
    ????????? ?? GC
  • ???????? ?? ????????? ? ?????? ? ?? ?????????? ??
    ??????? ????????????

53
?????????? ?????????
  • ???????????? ????????? ?? ???????? ???
    ????????????? ???????? ? Web ??????
  • ?? ?????????? ?????????? ? ?????? ????? ???
    ?????? BeginXXX() ? EndXXX()
  • ??? ?????????? ???????? ??????? ??????? ????? ??
    ??????? ????????? (callback)

public void static Main() AsyncCallback cb
new AsyncCallback(CallFinished)
service.BeginLongProcess(params, cb,
service) private void CallFinished(IAsyncResult
asyncResult) Console.WriteLine("Async call
completed.")
54
???????????? 8
  • ?????????? ????????? ?? Web ??????

55
Web ?????? ? ?????? ? ?????
  • Web ???????? ????? ?? ????????? ?? ?????? ??
    ?????
  • ?????????? ?? ?????????? DataSet ?????? ???
    ?????? ? ?????
  • Web ???????? ?????????
  • ??????????? ?? ?????
  • ????????? ?? ?????

56
???????????? 9
  • ?????? ?? ????? ???? Web ?????? ????????

57
???????????? 10
  • ?????? ?? ????? ???? Web ?????? ???????????
    ??????????

58
????????? ?? ?????
  • ASP.NET Web ???????? ????????? ?????, ?????
    ?????? Web ??????????
  • Session ??????? ???????? ?????
  • Application ??????? ????????? ?? Web
    ????????????
  • ??????????? ?? ??????? ??? ????????
  • ??????????? ?? ??????? ??? ???????

WebMethod(EnableSessiontrue)
MyService myService new MyService() myService.C
ookieContainer new System.Net.CookieContaine
r()
59
???????????? 11
  • ?????????? ?? ????? Web ??????

60
???????????? 12
  • ?????????? ?? ????? ?????? ?? Web ????????

61
????????? ?? Web ????????
  • ????? ???? ?? ??????? ????? ?????? ?? ?? ????? ??
    ?? ????? ??? ????????????
  • ???????? ?? ???????????? ?????? ???? ?? ??
    ??????? ?? ??????? ??????
  • ????? ????? ?? ??? ???????????? ?????????
    (??????????, ?????? ? ??.)
  • ???? ?????????? ?? ?????
  • ???? ?????????? ?? Web Services Enhancements
    (WSE). WSE ?????????
  • ?????????? ?? ???????
  • ??????? ??????????
  • ???????????? ???? ??????? ???????????

62
????????? ???? ?????
  1. ???????? ????? ?? ???????????? ?? ??????????

WebMethod(EnableSession true, Description
"Checks given login and creates a
session.") public void Login(string aUser,
string aPassword) if ( user/pass is valid
) Session"user" aUser
else throw new Exception("Ivalid
login!")
63
????????? ???? ?????
  1. ??? ????? ??????? ????? ??????????? ???? ???
    ???????????? ??????????

WebMethod(EnableSession true, Description
"This method requires active session.") public
string GetProtectedData() string user
(string) Session"user" if (user ! null)
return "This is protected data!"
else throw new
Exception("Access denied!")
64
???????????? 13
  • ?????? ?? ??????? ?? Web ?????? ???? ????? Web
    ????????

65
???????????? 14
  • ?????? ?? ??????? ?? Web ?????? ???? ?????
    ?????? ?? Web ????????

66
???????????? ? Web ????????
  • ?????? Web ?????? ?????? ??????????, ????????
    ???????? SoapException
  • ???????????? ??? ?? ???????????? ?? ????
  • ????? ?? ????????? (inner) ??????????
  • ??????? ?? ??????? (?????????? Message)
  • ?? ?? ??????? ?????????? ?? ???????, ????????? ?
    Web ?????
  • ?????????? ??????? ??? (enum), ????????
    ?????????? ??????
  • ??????? ?? Web ?????? ??? ?? ?????? ?????????
    ?? ????????? ???
  • ???????? ????????? ???? ?? ??????

67
???????????? ? Web ????????
WebMethod public UserError AddUser(string
aUser, string aPass) if ( aUser is invalid
) return UserError.InvalidUser if (
aPass is invalid ) return
UserError.InvalidPassword ... return
UserError.Success public enum UserError
Success, UserAlreadyExists, InvalidUser,
InvalidPassword, DatabaseError
68
Web ?????? ? ASP.NET
????????
69
??????????
  1. ????? ?????? ?? ???????????? ??????????
    ?????????? ????? ? ????????? ????? ????
  2. ????? ????????????? Web ????????? ????? ???????
    ?????? ???? ???????????
  3. ????? ???????????? ???????????????? ?? Web
    ????????? ?? ????? ?? ???????
  4. ????? ????????????? UDDI ???????????? ? ?? ?????
    ???????
  5. ????? ? DISCO ? ?? ????? ??????
  6. ????? ? WSDL ? ?? ????? ?? ?????????
  7. ????? ? SOAP? ?? ????? ?? ??????? ?? ????? ??
    ?????????
  8. ??????? ??????? ???????? ?? ?????????? ?? Web
    ?????? ??? .NET ???????? ??????????.

70
??????????
  1. ??? ?? ?????????? VS.NET ???????? ?????? Web
    ?????? (asmx ????), ????? ?? ???????? ???? ?????
    ???? ?? ????????? (?? ????????? ????).
    ???????????? Web ???????? ?? IIS. ????????? ?
    Internet Explorer. ??????????? WSDL ??????????.
  2. ??? ?? ?????????? VS.NET ???????? ??????
    (???????? ??????????) ?? Web ???????? ??
    ??????????? ??????.
  3. ? ??????? ?? VS.NET ???????? Web ??????, ?????
    ?????? 2 ???????? ???? ? ????? ????? ???? ???????
    ?? ????? ??? ??????. ??????????? ????????
    namespace ?? Web ????????. ??????? ?????????
    ???????? ?? Web ?????? ?.
  4. ? ??????? ?? VS.NET ???????? ?????? ??
    Web-???????? ?? ??????????? ??????.

71
??????????
  • ? ???? ??????? ???? ???????, ???????????? ?
    ???????? ???????. ?????? ??????? ?? ????? ????
    ???????? ??????? ?????????? ?? ?????? ???????? ?
    ???? ?? ??????? ?????? ?? ???????????? ?? ?????
    ???????. ???????????? ?????????? ?????, ????? ??
    ????????? ?????????? ?? ?????????, ?????????,
    ???????? ???????? ? ????????. ????????????
    Web-??????, ????? ????????? ???????? ????????
    (???? SQL ??????? ??? ??)
  • ????????/????????? ?? ????
  • ????????/?????????/??????? ?? ??????, ?????????
    ?? ????????? (?? ????? ????)
  • ????????/????????? ?? ?????? ???????, ?????????
    ?? ??. ???????? (?? ????? ????)
  • ????????/?????????/????????? ?? ?????? (?? ?????
    ?????? ?? ????? ???????)
  • ??????????? ????????? ????? ?? ADO.NET.

72
??????????
  1. ???????? Windows Forms ?????? ?? Web ???????? ??
    ??????????? ??????. ???????????? ?????? ??
    ??????????? ????????? ? ?? ????????? ?????????
    ???? ???. ??? ????? ?? ????? ???? ?????? ?? ??
    ???????? ?????????, ????? ?? ???????? ? ????????
    ????????, ????? ???? ??????? ????????. ?????? ??
    ?? ????????? ??????????? ?? ????????? ? ????????
    ???????? ?? ??????? ?????? ????. ??? ????? ??
    ?????? ?????? ?? ?? ????????? ??????????? ??
    ???????? ?? ?? ????? ?? ???????? ??????????. ???
    ????? ???????? ?????? ?? ?? ??????? Web ????? ??
    ???????? ???? ????? ??????????? ?? ?? ??????? ?
    ?????? ?????. ??? ??????? ?? ??????? ?????? ????,
    ?????? ?? ?? ???????? ?????? ????????? ?
    ??????????. ??? ??????? ?? ???????? ?????? ??????
    ???????? ?? ?? ?? ???????? ?????? ?? Web ????????.

73
??????????
  1. ???????? Web ??????, ????? ?? ???????? ???? ?????
    p (p e UInt32) ?????? ? ????? ???? ?????? ????? ?
    ????????? 1p. ???????? ?? ???????? ?? ??????
    ????? ??? ?????? ????????? ?? p. ???????? Windows
    Forms ??????????, ????? ??????? ???????? ????,
    ????? ? ??????. ??? ????????? ?? ????? ?
    ?????????? ???? ? ????????? ?? ?????? ?????? ??
    ?? ??????? ?????????? Web ???????? ?? ??????????
    ?? ???????? ????? ????? 1 ? p. ??? ?????????? ??
    ?????????? ????????? ?????????? ?????? ?? ??
    ?????? ? ??????? ??? ?????? "Primes in range
    1p are XXX". ?? ??????????, ?? ????????????
    ?????????? ????????? ????? ?? Thread Pool-? ??
    .NET Framework, ????? ?? ?????? ?? ?????????
    ???????? ?????????????? ?????????.

74
??????????
  1. ???????????? ?????????? ????? ?? ??????? ? MS SQL
    ??????, ????? ?????? ??????????? ? ??????? ?? ??
    ?????? ? ?????? ???????. ????? ?????????? ??
    ????????????? ? ???, login ? ?????? ? ???? ?? ???
    ?????? ?? ???????????? ?? ????????? ?? ?????????.
    ????? ??????? ? ????????? ?? ??? ??? ? ???? ?? ?
    ???????? ?? ???????????? ?? ?????????????.
    ???????? Web ??????, ????? ???? ?????????? ??
    ??????????? ????? ?? ?????? ?? ????? ? ADO.NET
    ????????? Web ?????? ?? ????????? ?? ??????? (???
    ??? ?? DataSet) ? ?? ?????????? ?? ?????????
    ????? (????????? ?? ? DataSet). ????????????
    Windows Forms ??????????, ????? ?????????
    ??????????? ?? ????????????? ? ??????? ?????
    ??????????? Web ????????.

75
??????????
  1. ???????????? ????????? ?? ?????????? ??
    ??????????? ? ??????? ????? ?? ??????????? ??????
    ???? ???????? ???????????? ? Web ???????? ?
    ???????? ???????? ?? ?????? ?? ??????? ????
    ASP.NET ???????. Web ???????? ?????? ?? ?????????
    ?????? ?? ?????????? ?????? ???? ?? ??????????? ?
    ??? "admin". ???????????? ???????? ????
    ?????????? ???????? ? ?????? ????? ?? ????.

76
?????????? ??????????
  • MSDN Library http//msdn.microsoft.com
  • ????? ????????, Web ?????? http//www.nakov.com/
    dotnet/2003/lectures/Web-Services.doc
  • MSDN Training, Developing XML Web Services Using
    Microsoft ASP.NET (MOC 2524B)
  • Enterprise Application http//c2.com/cgi/wiki?En
    terpriseApplication
  • Consuming a DataSet from an XML Web Service, MSDN
    Library http//msdn.microsoft.com
Write a Comment
User Comments (0)
About PowerShow.com