Integrating SAS in a Web Services Architecture


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Paper Number Title  Integrating SAS® in a Web Services Architecture Speaker(s)  Dan Jahn, SAS Institute Inc. Section  SAS Presents Skill Level  Technical Track(s)  Focus Sessions Track Intelligent Web Solutions Track Abstract  Several options are available to use SOAP-based Web Services to invoke SAS Stored Processes. These options include using IOM to create custom Web Service interfaces; using SAS BI Web Services; and upcoming technologies currently under development which will simplify the creation and use of SAS Stored Processes through Web Services. This session will explore the performance, administration, and development effort required for each of these options; as well as provide guidance on when Web Services are the best choice for integrating SAS into your applications. Schedule Information Location Day  Mon, Apr 11 Room  111 Start Time  01:30 PM  End Time  02:20 PM
  • End user gets a richer experience with Web Services. Things change…we’ll review the changes in store for SAS BI Web Services. I personally believe Web Services will help strike the balance between what runs on the desktop and server. What I would like you to do is understand your options for using SAS with Web Services. By understanding the roadmap for SAS and Web Services, you will be able to determine how to integrate SAS into your business.
  • Boundaries are explicit
  • Don Box uses the "antlers" to depict an 'object context' (derived from the COM notation.)
  • Boundaries are Explicit Services are Autonomous Services share Schema and Contract, not Class Compatibility is based upon Policy
  • Base64 encode Direct Internet Message Encapsulation Web Services Interoperability Organization Basic Profile 1.1 specifies SwA Some of the advantages of attachments include smaller message size, smaller memory requirements, smaller processing time (no need to convert binary data to base-64), and, most importantly, streaming.
  • .Net was built for COM Interop Same guys who made .Net made COM Use tlbimp VS.Net does this for you—Add a COM Reference Garbage collection – System.Runtime.InteropServices.Marshal.ReleaseComObject()
  • Boundaries are explicit
  • XMLA Web Service keyword
  • May provide simple interface to extract members from XML
  • May provide simple interface to extract members from XML
  • The WSDL that the SAS BI Web Services Explorer generates. Note that there are details in the schema of what parameters are expected; these details do not appear in the default XMLA Web Service.
  • SAS BI Web Services explorer
  • Returned data after executing SAS BI Explorer Web Service
  • Integrating SAS in a Web Services Architecture

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