1. Trang chủ
  2. » Công Nghệ Thông Tin

Web Services Tutorial phần 3 pptx

11 298 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 11
Dung lượng 749,72 KB

Nội dung

22 Currently Supported Protocols • SOAP 1.1 • Released SOAP 1.2 spec • WSDL 1.1 • WSDL 1.2 spec work in progress • UDDI v1 • Released UDDI v2 and v3 spec’s 23 VW Web Services Toolkit • Provides support in – creating XML to object binding from a schema – marshaling/unmarshaling XML types in to Smalltalk object and visa versa – creating classes from XML to object binding – building and deploying Web services from an existing application – creating classes from a WSDL schema and accessing Web services – searching and publishing Web services in UDDI registry Web Services Invocation 25 Loading WSDL Schema • WsdlBinding – loads and register a WSDL schema – creates Wsdl configuration – serves as a repository of WSDL schemas WsdlBinding loadWsdlBindingFrom: self wsdlSpecification readStream 26 How to access Web Services • WsdlClient – quick and easy way to invoke a service – doesn’t create any classes • WsdlClassBuilder – create client classes to invoke a service – can create Opentalk server and client and service classes • WsdlWizard – GUI tool available in vw 73 27 WsdlClient • Loads and parses a Wsdl schema • Creates default binding to dictionaries • Invokes a Web services client := WsdlClient url: ‘http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl'. rate := client executeSelector: #getRate args: (Array with: 'usa' with: ‘canada') 28 WsdlClassBuilder • Loads and parses a Wsdl schema • Creates XML to object binding and classes from it • Creates client, server and service classes builder := WsdlClassBuilder readFrom: 'http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl' asURI. builder package: 'CurrencyExchange'. 29 Creating WSDL Client Class clientClass := builder createClientClasses first. - derived from WsdlClient - created for each WSDL port Smalltalk defineClass: #CurrencyExchangePortClient superclass: #{WebServices.WsdlClient} #getRateCountry1: aString country2: aString1 #initialize super initialize. self setPortNamed: 'CurrencyExchangePort'. #class wsdlSchema "(WebServices.WsdlBinding loadWsdlBindingFrom: self wsdlSchema readStream.)" … WSDL schema with XML to object binding Port is registered in WsdlPort.PortRegistry 30 Testing WSDL Client client := clientClass new. client createScript inspect. rate := client getRateCountry1: ‘usa’ country2: ‘canada’ 31 Creating Service Class Stub serviceClass := builder createServiceClasses first. Smalltalk defineClass: #CurrencyExchangeBinding superclass: #{Core.Object} getRateCountry1: aString country2: aString1 <operationName: #getRate > <addParameter: #country1 type: #String > <addParameter: #country2 type: #String > <result: #Float > ^self "Add implementation here" [...]... #getRateCountry1: aString country2: aString1 ^proxy getRateCountry1: aString country2: aString1 #serverUrl ^'http:/ /services. xmethods.net:80/soap‘ Request Broker WSDL schema with XML to Object Binding #class wsdlSchema "(WebServices.WsdlBinding loadWsdlBindingFrom: self wsdlSchema readStream.)" 32 . deploying Web services from an existing application – creating classes from a WSDL schema and accessing Web services – searching and publishing Web services in UDDI registry Web Services Invocation 25 Loading. 1.2 spec • WSDL 1.1 • WSDL 1.2 spec work in progress • UDDI v1 • Released UDDI v2 and v3 spec’s 23 VW Web Services Toolkit • Provides support in – creating XML to object binding from a schema –. #CurrencyExchangePortClient superclass: #{WebServices.WsdlClient} #getRateCountry1: aString country2: aString1 #initialize super initialize. self setPortNamed: 'CurrencyExchangePort'. #class wsdlSchema "(WebServices.WsdlBinding

Ngày đăng: 14/08/2014, 19:20