Web Services Tutorial phần 4 pptx

11 268 0
Web Services Tutorial phần 4 pptx

Đ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

33 Creating Opentalk Server builder opentalkServerName: ‘ExchangeServer’. serverClass := builder createOpentalkServerClass. Smalltalk defineClass: #ExchangeServer instanceVariableNames: 'interfaces servers ‘ #portDescription <serviceClass: #CurrencyExchangeBinding address: #'http://services.xmethods.net:80/soap' bindingType: #soap wsdlBinding: #CurrencyExchangeBinding > <wsdlServiceImplementation: #CurrencyExchangeService > ^self Request Brokers Corresponds WSDL <port> element 34 Testing locally  Implement service method: serviceClass>>getRateCountry1:country2: ^123  Change server port to a local host: serverClass class>>portDescription <serviceClass: #'WebServices.LibraryServices' address: #'http://localhost:4920' … >  Set server access point for the client clientClass>>serverUrl ^'http://localhost:4920' 35 Testing Opentalk Server and Client client := clientClass new start. [client getRateCountry1: 'usa' country2: ‘canada' ] ensure: [ client stop ] server := serverClass new. server startServers. “Invoke client request” server stopServers. 36 WsdlClassBuilder Settings • Default package – WSDefaultPackage • Default proxy client port – 4930 • Use existing classes or generate a new uniquely named class – yes 37 WSDL Wizard Released in 7.3 38 Show Time Review • Loaded a Wsdl schema • Created XML to object binding • Created classes from the binding • Created a client for each port • Created a script to invoke services Building and Deploying Web Services 40 Steps to build Web Services • Provide services description – Provide description to service interfaces – Provide description to service parameters, result and exception types • Create a Wsdl schema • Create Opentalk server • Create Opentalk client 41 Classes to do the job • WsdlBuilder – expects service and types description – creates a WSDL schema from a service class • WsdlClassBuilder – creates Opentalk server and client classes • WSDLWizard – helps to describe types – creates Opentalk server and client classes – tests client-server communication – creates Wsdl schema 42 Service description Should include: – Operation name – Parameter , result and exception types WSLDSrvcGeneralPublic holdingByAcquisitionNumber: anAcquisitionNumber <operationName: #'HoldingByAcquisitionNumber'> <addParameter: #‘acquisitionNumber' type: #'LargePositiveInteger'> <result: #'LDHoldingBook'> <addException: #NotFound type: #'LDExcHoldingNotFound'> ^library ownedHoldings detect:[ :x | x acquisitionNumber = aLDHolding_acquisitionNumber ] ifNone:[ LDExcHoldingNotFound raise] [...]... Struct To be resolved should be fully qualified LDAgent #borrowedHoldings: aCollOfLDHoldingBook . a client for each port • Created a script to invoke services Building and Deploying Web Services 40 Steps to build Web Services • Provide services description – Provide description to service. #'WebServices.LibraryServices' address: #'http://localhost :49 20' … >  Set server access point for the client clientClass>>serverUrl ^'http://localhost :49 20' 35 Testing. aCollOfLDHoldingBook <addAttribute: #(#borrowedHoldings #optional) type: #( #Collection #‘WebServices.LDHoldingBook' )> borrowedHoldings := aCollOfLDHoldingBook To be resolved should

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

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan