Lean Architecture: integrating architecture and agile projects
Integrating SAS in a Web Services Architecture
Transcript of Integrating SAS in a Web Services Architecture
Copyright © 2005, SAS Institute Inc. All rights reserved.
Integrating SAS® in a Web Services Architecture Dan JahnDeveloper – SAS Cary
Copyright © 2005, SAS Institute Inc. All rights reserved.
Web Services Driving the Pendulum
Power on the ServerBack-end serversMid-Tier servers
Power on the DesktopSmart Client
Copyright © 2005, SAS Institute Inc. All rights reserved.
Agenda
Introduce Stored Processes
When to Use Web Services
Technical roadmap for developing Web Services with SAS
Copyright © 2005, SAS Institute Inc. All rights reserved.
Stored Process
SAS Code• Runs on SAS Stored Process Server
Metadata• Stored in SAS Metadata Server
Copyright © 2005, SAS Institute Inc. All rights reserved.
SAS BI Web Services
SAS Stored Process Server
SAS Metadata Server
SAS Stored Processes
Enterprise Guide
ETL Studio
Stored Process Web App
Custom Java/.Net code
Web Report Studio
Desktop SAS + SASMC
Copyright © 2005, SAS Institute Inc. All rights reserved.
When to use Web Services
Interoperability• Java and .Net clients
• Servers, desktops, devices
• Based on Standards!!!
Not for lots of Data
SOA!?!• SAS makes it easy to use SOA without Web Services
Copyright © 2005, SAS Institute Inc. All rights reserved.
SOA
Copyright © 2005, SAS Institute Inc. All rights reserved.
4 Tenets of Service Oriented Architecture
Boundaries are Explicit
Services are Autonomous
Services share Schema and Contract, not Class
Compatibility is based upon Policy
Copyright © 2005, SAS Institute Inc. All rights reserved.
Attachments
Inline
WS-Attachments == DIME
SwA == Soap with Attachments == WS-I
MTOM == SOAP Message Transmission Optimization Mechanism==W3C
Copyright © 2005, SAS Institute Inc. All rights reserved.
SAS Web Service Roadmap
Three Implementation Phases:
1. Write a custom Web Service – SAS v7
2. SAS BI Web Services Version 1 – SAS 9.1
3. SAS BI Web Services Version 2 – SAS 9.2
Copyright © 2005, SAS Institute Inc. All rights reserved.
Phase 1: Custom Web Service
Highly customizable
You write the code for the Web Service
Custom level of Platform integration
Samples available in .Net and Java
Copyright © 2005, SAS Institute Inc. All rights reserved.
Custom Web Service
SAS Workspace ServerClient Application
SOAPIOM
Custom Web Service
Copyright © 2005, SAS Institute Inc. All rights reserved.
IOM
Integrated Object Model
Originally Workspace Server; now OLAP, Metadata, and StoredProcess Servers
Copyright © 2005, SAS Institute Inc. All rights reserved.
Custom Web Service in .Net
ObjectManager – makes connections to SAS
Workspace Server has OLE/DB interfaces for use with ADO
obServer.MachineDNSName = “localhost”;obServer.Port = 5307;iWorkspace = obObjectFactory.CreateObjectByServer(“”, true, obServer, “userName”, “password”, xmlInfo);…iSP.Execute("GetCreditLimit", "custname" + "=" + custName + " custid=" + custID + " outData=work.out");
Copyright © 2005, SAS Institute Inc. All rights reserved.
Custom Web Service in Java
SAS Foundation Services
Workspace Server has JDBC interfaces
serverInfo.put("host", "localhost");serverInfo.put("port", "5307");serverInfo.put("userName", "username");serverInfo.put("password", "password");IWorkspace iWorkspace = wsf.createWorkspaceByServer(serverInfo); …iSP.Execute("GetCreditLimit", "custname" + "=" + custName + " custid=" + custID + " outData=work.out");
Copyright © 2005, SAS Institute Inc. All rights reserved.
Workspace or StoredProcess Server?
You can use either for your custom Web Service
Data interfaces with Workspace only
Workspace server designed for long-held connections (Enterprise Guide).
StoredProcessServer designed for quick, web transactions.
Copyright © 2005, SAS Institute Inc. All rights reserved.
Phase 2: SAS BI Web Services SAS9.1
Uses StoredProcesses that run on a StoredProcessServer
XMLA Generic WSDL – Execute and Discover
StoredProcesses must generate XML with XML Libname Engine
Copyright © 2005, SAS Institute Inc. All rights reserved.
SAS BI
Web Services
SAS Stored Process Server
SAS Metadata Server
Client Application
SOAP
IOM
IOM
SAS BI Web Services
Copyright © 2005, SAS Institute Inc. All rights reserved.
Create A Stored Process
Install: Decide on Java or .Net on Web Server
Write the SAS Program
Use SAS Management Console to define metadata
Copyright © 2005, SAS Institute Inc. All rights reserved.
Write the SAS Program
Inputs: Macros and filerefs containing XML• Parameter Macro
• Stream Fileref (containing XML)
Output: _WEBOUT fileref containing XML
XML Libname Engine
Errors: SYSCC and SYSMSG
Copyright © 2005, SAS Institute Inc. All rights reserved.
Example SAS Code
libname instream xml;
libname _WEBOUT xml xmlmeta=&_XMLSCHEMA;
proc means data=instream.&tablename;
output out=_WEBOUT.mean;
run;
Copyright © 2005, SAS Institute Inc. All rights reserved.
Define Metadata
SAS Management Console
1. Define a Server
2. Define a User
3. Define a StoredProcess
Copyright © 2005, SAS Institute Inc. All rights reserved.
SAS Code
libname _WEBOUT xml xmlmeta=&_XMLSCHEMA;
Client Code (Excel VBA)
Set nodeList = ws.wsm_Execute(...
Copyright © 2005, SAS Institute Inc. All rights reserved.
SAS Code
libname instream xml;
Client Code (Excel VBA)
"<Stream name='instream'>
<Table><myData><col1>4</col1></myData></Table>
</Stream>“
Copyright © 2005, SAS Institute Inc. All rights reserved.
SAS Code
proc means data=instream.&tablename;
Client Code (Excel VBA)
<Parameter name='tablename'>myData</Parameter>
Copyright © 2005, SAS Institute Inc. All rights reserved.
Make it Easier to Use
SAS BI Web Services Wizard• Visual Studio .Net add-in
• Generates C# and VB code
SAS BI Web Services Explorer• ASP.Net Web Application
• Explore available StoredProcesses
• Create WSDL files
Copyright © 2005, SAS Institute Inc. All rights reserved.
Phase 2: Call a Web Service From SAS
Use Mid-Tier as controller and communicate with SAS through IOM
Copyright © 2005, SAS Institute Inc. All rights reserved.
Phase 3: SAS BI Web Services v2
Detailed WSDL
Attachments – MTOM
ODS or XML Libname Engine
Copyright © 2005, SAS Institute Inc. All rights reserved.
Phase 3: Defining Metadata
Using SAS Management Console:
Define the Stored Process
Select a set of Stored Processes to Define the Web Service
No special Keywords (XMLA Web Service)
Copyright © 2005, SAS Institute Inc. All rights reserved.
Phase 3: Call a Web Service From SAS
proc soap;
Use XML libname engine to read/create XML
May choose to use XSL
Copyright © 2005, SAS Institute Inc. All rights reserved.
Other Presentations
Tuesday 2:30 Room 107 – DelGobbo/Wolfe – “Using Parameters to Create Intelligent Stored Processes”
Tuesday 3:30 Room 107 - White/Wolfe – “Stored Process Creation, Testing and Maintenance via SAS Enterprise Guide”
Copyright © 2005, SAS Institute Inc. All rights reserved.
Samples and Documentation
http://support.sas.com/rnd/itech• ‘Samples’ Link
• ‘Library’ Link
Copyright © 2005, SAS Institute Inc. All rights reserved.
Contact Me
Demo Area:• Today: 5pm-7pm
• Tuesday: 11:45am-5pm
• Wednesday: 8:30-10am
Copyright © 2005, SAS Institute Inc. All rights reserved.Copyright © 2005, SAS Institute Inc. All rights reserved. 34
Copyright © 2005, SAS Institute Inc. All rights reserved.
Copyright © 2005, SAS Institute Inc. All rights reserved.
Copyright © 2005, SAS Institute Inc. All rights reserved.
Copyright © 2005, SAS Institute Inc. All rights reserved.