1、WEB服务初级编程,祝伟华网络新型服务技术中心,内容,分布式计算互联网分布式计算标准定义发布使用其它特性,分布式计算,Procedure CallRemote Procedure Call (RPC)TuxedoCORBARMI/IIOP/EJB 基于浏览器客户端分布式计算Rich ClientJAVA APPLETJAVASCRIPT/AJAXCOM/COM+/DNAWeb Service/SOAP/SOA,互联网分步式计算,Application,Devices,Browsers,OS andlocal services,Vertical andportal service,App-spe
2、cificWeb Service,Building blockWeb Service,Access Application,Call Services,Web ServicesContract,基于互联网分布式计算标准,HTTPXMLSOAP (Simple Object Access Protocol)Web Service Description Language (WSDL)DISCOUDDI (Universal Discovery, Description, and Integration ),WEB服务架构,Web Service,Web ServiceClient,定义,WebS
3、ervice Directive (页面定义)Settings for ASP.NET compilersWebMethod Attribute (后台代码定义)Code Declaration SyntaxOutlineInline (in C#),using System.Web.Services;public class MathService : WebService WebMethod .,定义,using System;using System.Web.Services;public class MathService WebMethod public int Subtract(i
4、nt a, int b) return a - b; public int Subtract_vs(int a, int b) return b - a; ,发布,Expose Web Service and Web Service methodsCreate a Web Service proxy and an assemblyGenerate proxy with WebServiceUtil toolCreate an assemblyEnables developers to program against Web ServicesPublish WSDL contract and H
5、TML descriptionWeb Service clientsCan be Web applications or browsers思考: 代理类, SOAP协议间数据如何传递和转换?,发现,.disco fileXML-based filecontaining links to resources for retrieving WSDLStored in the servers root directoryAccess via URL and dynamic discovery documentStart discovering with the WebServiceUtil tool
6、Automatically created by Visual Studio.NETGlobal directory of Web Services through UDDIUniversal Discovery, Description, and Integration (http:/www.uddi.org),使用,Web ServiceDeveloper,Web ApplicationDeveloper,Web Server 1,Service App,asmx,.aspx,Web Server 2,Service App,Proxy,Web Form,使用,Create client
7、proxy classInput:WSDL contractProxy language and protocolOutput:Single source file in specified language, containing:Proxy classCode for network invocation and marshallingCommand-line example: webserviceutil /c:proxy /l:C# /namespace:MathServiceSpace MathService.sdl,使用,Request without method name an
8、d parametersHTML description of Web ServiceService capabilities, methods, protocolsWeb Service can return WSDLHTTP-GET, HTTP-POST, and HTTP-SOAPRequest with parameter “?SDL”Formal WSDL description of Web ServiceXML-based grammarCan be used as input for WebServiceUtil.exe,使用 (通过HTTP协议),Web Services a
9、re URL addressableHTTP requestProtocolsHTTP-GETMethod name and arguments in URLHTTP-POSTMethod name and arguments in POST bodyHTTP-SOAPXML grammar forAddressing the Web ServiceReturning results,使用 (HTTP/GET/POST),http:/server/appl/service.asmx/method?param=valueStandard HTTP-GETMethod name = PATHINF
10、OMethod arguments = URL query stringQuery string key = parameter nameMultiple parametersOnly primitive .NET runtime data typesResult is an XML documentAny .NET data typeHTTP-POSTSimilar to GET, but with arguments in the form body,使用 (HTTP/SOAP调用),XML grammar forWeb Service method, method parameters,
11、 resultsSupports all standard .NET data types and value classesAdditionally: classes, structs, datasetsClass and struct marshallingSerialization in XML format,WSDL,XML grammar, defining:Services and ports that communicate via messagesBindingSpecify a protocol or a data format for a message or a portExtensions for SOAP 1.1, HTTP GET/POST, and MIMEPublic description of a Web Service and its contentWSDL contractCore Elements of WSDLservice, port, and portTypeoperations and messages,WSDL, ,高级特性,状态管理安全性事务处理,SOA,Service Oriented ArchitectureEAI (Enterprise Application Integration),
Copyright © 2018-2021 Wenke99.com All rights reserved
工信部备案号:浙ICP备20026746号-2
公安局备案号:浙公网安备33038302330469号
本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。