Visual Age Smalltalk Web Services Experience Report Alison
Visual. Age Smalltalk Web Services Experience Report Alison Dixon dixona@attglobal. net ESUG August 2002
Current Environment • Large financial application • Large user base spread over wide geographic area • VAST 6. 0 Fat Client • OS/2 moving to Windows XP • OS/2 server for near future Alison Dixon dixona@attglobal. net ESUG August 2002
Current Environment Requirements • High uptime • High speed • Peripheral support Alison Dixon dixona@attglobal. net ESUG August 2002
Why Web Services? • Re-use of current business logic • Access to information from external and internal providers • Possible migration path to newer client technologies Alison Dixon dixona@attglobal. net ESUG August 2002
Web Service Prototypes • Simple string concatenation • Insurance example • Client locate - complex input and output • External service consumption with complex input and output Alison Dixon dixona@attglobal. net ESUG August 2002
Various Client Types • VA client • C#. net • ASP. net • Java thick and thin (created using WSAD) Alison Dixon dixona@attglobal. net ESUG August 2002
What is a Web Service? • Web Services are self-contained, modular applications that can be: • Described • Published • Found • Bound • Invoked • Composed Alison Dixon dixona@attglobal. net ESUG August 2002
Web Services Service Provider Service Broker Alison Dixon nd Pub Bi lish • How does it work? Find Service Requester dixona@attglobal. net ESUG August 2002
Service Oriented Architecture DL WS Pu d Bin AP Service Broker SO bli sh Service Provider UDDI Find Service Requester • Web Service Definition Language: an XML based interface definition language for network based services • Universal Description Discovery & Integration: a standards based architecture specification for service description and discovery. (www. uddi. org) • Simple Object Access Protocol: a lightweight XML based protocol for the exchange of information in a decentralized, distributed environment. Alison Dixon dixona@attglobal. net ESUG August 2002
VA Web Services Platform • SST – Transports – Dispatching • XML – Schema based SAX parsing handlers – Uses the existing SAX engine • Supports SOAP over HTTP – 0. 40 beta has HTTPs (client) • Maintain Smalltalk Semantics – Messaging – Faults Alison Dixon dixona@attglobal. net ESUG August 2002
The Files • . wsdl (parent and imported) • . xml (client and server) • . map (client and server) Alison Dixon dixona@attglobal. net ESUG August 2002
WSDL • Allows separation of implementation and interface • High-level WSDL has interface specs – location of service • Imported file contains schema and service messaging specs Alison Dixon dixona@attglobal. net ESUG August 2002
XML • Allows specification of the Smalltalk deployment • Define mapping specs and wsdl • Custom handlers • Able to specify client and server side • Allows user to specify whether service will run remote or local Alison Dixon dixona@attglobal. net ESUG August 2002
Mapping • Allows conversion between web service elements or types and Smalltalk classes • Useful for mapping between Array and Ordered. Collection Alison Dixon dixona@attglobal. net ESUG August 2002
Web Services Container • The key element in the implementation, the Services Container is responsible for the storage and manipulation of all information relating to deployed Web services • Client and server have their own separate containers Alison Dixon dixona@attglobal. net ESUG August 2002
Serialization Manager • Makes available cached information (retrieved when the service was deployed) that enables serialization and deserialization of SOAP messages • Responsible for loading/storing XML Mapping specs named in VA ST Web services deployment descriptor • Responsible for loading/storing XML schemas referenced in deployed WSDL • Two level resolution of resources – First me – Then Abt. Xml. Object. Cache Alison Dixon dixona@attglobal. net ESUG August 2002
Handlers • VA web services supports various handlers • Add to deployment descriptor for customized processing Alison Dixon dixona@attglobal. net ESUG August 2002
Current Status • Functioning prototypes with various clients • Packaged client runtime Alison Dixon dixona@attglobal. net ESUG August 2002
Struggles Along the Way • Proxy server • Use of arrays in C# and Java • Multi-references in C# - interoperability • Organizing the files and discovering the purposes • Beta code Alison Dixon dixona@attglobal. net ESUG August 2002
Proxy Server Authentication • Setting of credentials with Base 64 encoding (Sst. Transport configuration. Registry at: 'http') proxy. Credentials: 'Basic CCQw. XXXNNN 5 ka. WRR'. • Setting of proxy url (Sst. Transport configuration. Registry at: 'http') proxy. Url: ('http: //proxy: 8080') sst. As. Url. Alison Dixon dixona@attglobal. net ESUG August 2002
Content of an External WSDL (Sst. Xml. Resource. Reader new fetch: ('http: //www. xmethods. net/sd/Temperature. Servic e. wsdl' sst. As. Url)) inspect. (Sst. Xml. Resource. Reader new fetch: ('http: //www. alethea. net/webservices/zipcode. as mx? wsdl' sst. As. Url)) inspect. Alison Dixon dixona@attglobal. net ESUG August 2002
Invoking Remote Web Services [ | a. Container a. Service. Collection| a. Container : = Sst. WSContainer container. Named: Sci. Socket. Manager default get. Host. Name. a. Service. Collection : = a. Container deploy: 'http: //www. xmethods. com/sd/Stock. Quote. Service. wsdl'. ( a. Service. Collection first get. Quote: 'QCOM' ) inspect] fork Alison Dixon dixona@attglobal. net ESUG August 2002
Troubleshooting • Settings for disabling trapping of exceptions – Tools > SST > Trap exceptions – Tools > SST > Forward exceptions • Forking of actions Alison Dixon dixona@attglobal. net ESUG August 2002
Use of Handlers for Performance Timings • How we took timings – Use of web service handlers – Addition of performance info to the wsdl • What we learned about our application Alison Dixon dixona@attglobal. net ESUG August 2002
Client-side Output Handler • Add a handler to the client container | chain : = (Sst. WSContainer container. Named: 'Enterprise. Banker. Services') handler. Factory handler. Named: 'ws. Client. Input. Message. Constructor'. chain add. Handler: (Wc. WSClient. Container. Output. Handler new name: 'container. Output. Header. Handler') Alison Dixon dixona@attglobal. net ESUG August 2002
Client-side Output Handler • The following adds information to the SOAP header invoke: an. Sst. WSMessage. Context " Write performance timings to the output message. " | container. Header. Element : = self new. Element. From: an. Sst. WSMessage. Context. container. Header. Element time. Parsing. At. Client: Time now as. Milliseconds as. String; time. Invoked. At. Client: Wc. Performance. Timings time. Invoked. At. Client. an. Sst. WSMessage. Context current. Message add. Header. Element: container. Header. Element Alison Dixon dixona@attglobal. net ESUG August 2002
Client-side Input Handler • Add a handler to the client side xml file <handlers namespace="urn: vast. Performance. Globals"> <handler name="vast. Performance" class="Wc. WSClient. Container. Input. Handler"/> </handlers> • Add code to the invoke: method of your class ‘Wc. WSClient. Container. Input. Handler’ invoke: an. Sst. WSMessage. Context " Perform any client-side handler processing " | performance. Info : = an. Sst. WSMessage. Context property. Named: WSCustom. Handler. Element. Wc. Performance. Timings time. Invoked. At. Client: performance. Info time. Invoked. At. Client; time. Parsing. At. Client: performance. Info time. Parsing. At. Client; ………. (cont) Alison Dixon dixona@attglobal. net ESUG August 2002
Server-side Input Handler • Add a handler to the server side xml file <handlers namespace="urn: vast. Performance. Globals"> <handler name="vast. Performance" class="Wc. WSServer. Container. Input. Handler"/> </handlers> • Add code to the invoke: method of the above class Alison Dixon dixona@attglobal. net ESUG August 2002
Server-side Output Handler • Add a handler to the server container <handler name="ws. Global. Response. Server. Handler" class="Wc. EBanker. Container. Header. Ou tput. Handler"/> • Add code to the invoke: method of the above class Alison Dixon dixona@attglobal. net ESUG August 2002
Performance Timings Alison Dixon dixona@attglobal. net ESUG August 2002
Performance Timings cont. Alison Dixon dixona@attglobal. net ESUG August 2002
Next Steps • Consuming a web service from another department • Implementing our framework for web services • Serverizing our code Alison Dixon dixona@attglobal. net ESUG August 2002
- Slides: 32