Setting up an Apache Server in Conjunction with the SAP Sybase OData Server

Similar documents
Data Integration using Integration Gateway. SAP Mobile Platform 3.0 SP02

Upgrade: SAP Mobile Platform Server for Windows SAP Mobile Platform 3.0 SP02

Create and run apps on HANA Cloud in SAP Web IDE

Using SAP Logon Tickets for Single Sign on to Microsoft based web applications

How-To Guide SAP NetWeaver Document Version: How To Guide - Configure SSL in ABAP System

SAP NetWeaver Identity Management Identity Services Configuration Guide

R49 Using SAP Payment Engine for payment transactions. Process Diagram

SAP BW on HANA & HANA Smart Data Access Setup

Landscape Design and Integration. SAP Mobile Platform 3.0 SP02

Spectrum Technology Platform

LVS Troubleshooting Common issues and solutions

SAP ERP E-Commerce and SAP CRM Web Channel Enablement versions available on the market

Extend the SAP FIORI app HCM Timesheet Approval

CentraSite SSO with Trusted Reverse Proxy

PROXY SETUP WITH IIS USING URL REWRITE, APPLICATION REQUEST ROUTING AND WEB FARM FRAMEWORK OR APACHE HTTP SERVER FOR EMC DOCUMENTUM EROOM

How-to-Guide: SAP Web Dispatcher for Fiori Applications

Installation Guide: Agentry Device Clients SAP Mobile Platform 2.3

How to Extend a Fiori Application: Purchase Order Approval

SEPA in SAP CRM. Application Innovation, CRM & Service Industries. Customer

Creating a Fiori Starter Application for sales order tracking

How-To Guide SAP Cloud for Customer Document Version: How to Configure SAP HCI basic authentication for SAP Cloud for Customer

Sybase ASE Linux Installation Guide Installation and getting started guide for SAP Sybase ASE on Linux

SAP Best Practices for SAP Mobile Secure Cloud Configuration March 2015

Oracle9i Application Server: Options for Running Active Server Pages. An Oracle White Paper July 2001

Login with Amazon. Getting Started Guide for Websites. Version 1.0

SAP Mobile Documents. December, 2015

SAP BusinessObjects Query as a Web Service Designer SAP BusinessObjects Business Intelligence platform 4.0

Getting Started with the License Administration Workbench 2.0 (LAW 2.0)

GR5 Access Request. Process Diagram

SAP BusinessObjects Business Intelligence 4 Innovation and Implementation

Certification Guide Network Connectivity for SAP on Premise and Cloud Solutions Integration

Installing and Configuring the HANA Cloud Connector for On-premise OData Access

Set Up Hortonworks Hadoop with SQL Anywhere

How to setup HTTP & HTTPS Load balancer for Mediator

SAP Mobile - Webinar Series SAP Mobile Platform 3.0 Security Concepts and Features

How-to guide: Monitoring of standalone Hosts. This guide explains how you can enable monitoring for standalone hosts in SAP Solution Manager

Cloud Single Sign-On and On-Premise Identity Federation with SAP NetWeaver Cloud White Paper

Configuring Single Sign-on for SAP HANA

Configuring Remote HANA System Connection for SAP Cloud for Analytics via Apache HTTP Server as Reverse Proxy

ACCESSING THE PROGRESS OPENEDGE APPSERVER FROM PROGRESS ROLLBASE USING JSDO CODE

How-to-Guide: Apache as Reverse Proxy for Fiori Applications

SAP Project Portfolio Monitoring Rapid- Deployment Solution: Software Requirements

R/3 and J2EE Setup for Digital Signature on Form 16 in HR Systems

How To Make Your Software More Secure

Secure MobiLink Synchronization using Microsoft IIS and the MobiLink Redirector

SAP HANA SPS 09 - What s New? Development Tools

How to Configure an Example SAP Cloud Applications Studio (PDI) Solution for SAP Cloud for Customer

Backup & Restore with SAP BPC (MS SQL 2005)

HP Asset Manager. Implementing Single Sign On for Asset Manager Web 5.x. Legal Notices Introduction Using AM

Mobile app for Android Version 1.0.x, January 2014

SAP Business One mobile app for Android Version 1.0.x November 2013

Set Up Hortonworks Hadoop with SAP Sybase IQ

Integration of Universal Worklist into Microsoft Office SharePoint

Price and Revenue Management - Manual Price Changes. SAP Best Practices for Retail

Instant Chime for IBM Sametime Installation Guide for Apache Tomcat and Microsoft SQL

DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP LTM with Apache Tomcat and Apache HTTP Server

K88 - Additional Business Operations for Loans. Process Diagram

SAP Business Intelligence Suite Patch 10.x Update Guide

HR400 SAP ERP HCM Payroll Configuration

Developing Applications for Integration between PI and SAP ERP in Different Network Domains or Landscapes

How to Create Web Dynpro-Based iviews. Based on SAP NetWeaver 04 Stack 09. Jochen Guertler

Unlock the Value of Your Microsoft and SAP Software Investments

MASTERTAG DEVELOPER GUIDE

A Cloud-Based Foundation for Enterprise Mobility

Process Archiving using NetWeaver Business Process Management

Configuring Java IDoc Adapter (IDoc_AAE) in Process Integration. : SAP Labs India Pvt.Ltd

Run SAP Risk Management in Utilities to Get Business Value Fast

Setting up Single Sign-On (SSO) with SAP HANA and SAP BusinessObjects XI 4.0

Setting Up B2B Data Exchange for High Availability in an Active/Active Configuration

Mobile app for Android Version 1.2.x, December 2015

Mobile app for ios Version 1.10.x, August 2014

How to Implement Mash Up to Show ECC Screen in SAP Cloud for Customer

Real-Time Reconciliation of Invoice and Goods Receipts powered by SAP HANA. Stefan Karl, Finance Solutions, SAP ASUG Presentation, May 2013

Software and Delivery Requirements

OData in a Nutshell. August 2011 INTERNAL

Manual to Access SAP Training Systems Technical Description for Customer On-Site Training

Varian Medical Systems: Maximizing the Speed of Mobile Apps with SAP Enterprise Support

2013 IBM SINGLE SIGN-ON WITH CA SITEMINDER FOR SAMPLE WEB APPLICATION

Building the SAP Business One Cloud Landscape Part of the SAP Business One Cloud Landscape Workshop

White Paper DEPLOYING WDK APPLICATIONS ON WEBLOGIC AND APACHE WEBSERVER CLUSTER CONFIGURED FOR HIGH AVAILABILITY AND LOAD BALANCE

SITEMINDER SSO FOR EMC DOCUMENTUM REST

Visualizing a Neo4j Graph Database with KeyLines

SAML Authentication with BlackShield Cloud

Harness the Power of Analytics Across Lines of Business with Speed and Ease

Website Login Integration

SAP HANA Cloud Integration CUSTOMER

HP ALM. Software Version: External Authentication Configuration Guide

Spectrum Technology Platform Version Tutorial: Load Balancing Spectrum Spatial Services. Contents:

Crystal Server Upgrade Guide SAP Crystal Server 2013

SAP HANA SPS 09 - What s New? HANA IM Services: SDI and SDQ

How to configure BusinessObjects Enterprise with Citrix Presentation Server 4.0

Open Items Analytics Dashboard System Configuration

Agentry and SMP Metadata Performance Testing Guidelines for executing performance testing with Agentry and SAP Mobile Platform Metadata based

Tutorial: BlackBerry Object API Application Development. Sybase Unwired Platform 2.2 SP04

StreamServe Persuasion SP5 StreamStudio

Partner Certification to Operate SAP Solutions and SAP Software Environments

Mobile app for ios Version 1.11.x, December 2015

Transcription:

Setting up an Apache Server in Conjunction with the SAP Sybase OData Server PRINCIPAL AUTHOR Adam Hurst Philippe Bertrand adam.hurst@sap.com philippe.bertrand@sap.com REVISION HISTORY Version 1.0 - June 2013

TABLE OF CONTENTS OVERVIEW... 3 GOAL... 4 HOSTING THE SAP SYBASE ODATA SERVER... 5 Launching the SAP Sybase OData Server... 5 Setting up the Apache HTTP Server... 5 Setting up the Web Application... 6 APPENDIX... 7 salesorders.html... 7 salesorders.js... 9 odata_config.properties... 12 odata.osdl... 13 2

OVERVIEW The Apache HTTP Server is the most popular HTTP Server software in use. This document provides an introduction to using the SAP Sybase OData Server to create a web application with rich OData content and functionality where the Apache HTTP Server is preferred as the Internetfacing web server. OData (Open Data Protocol) enables data services over RESTful HTTP. It allows you to perform operations through URIs (Universal Resource Identifiers) to access and modify information. The SAP Sybase OData Server consists of the following components: 1. The OData Producer The OData Producer is a Java Servlet that uses the JDBC API to connect to a SQL Anywhere database server. It processes OData requests and responses, and interfaces with the database. 2. An HTTP server An HTTP server handles OData requests from the client and acts as a Java Servlet Container for the OData Producer. To successfully complete the procedures in this document, you must acquire and install the following software: Apache HTTPD 2.2.22 The Apache HTTP Server is a popular open source HTTP Web Server. This web server is used to host the web application and act as the Internet-facing intermediate for OData traffic between the web clients and the SAP Sybase OData Server. SQL Anywhere 16 SQL Anywhere contains the necessary components to allow the SAP Sybase OData Server to interface with SQL Anywhere database servers. It also provides a sample SQL Anywhere database that is used as the data source for the web application. The rest of this document assumes that SQLANY_HOME is the root directory of the SQL Anywhere installation. Datajs 1.0.3 Datajs is an OData client library for JavaScript. This library is used to facilitate requesting and receiving OData content in the web application. 3

GOAL This document provides a procedure for configuring and deploying a web application with rich OData content and functionality where the Apache HTTP Server is used as the Internet-facing web server. The web application files are hosted by the Apache HTTP Server, while OData requests made by the web application are proxied through to the SAP Sybase OData Server and satisfied by a SQL Anywhere database server. The following diagram describes the back-end setup of the hosted web application. Web Client (Browser) Datajs Web Application OData Requests Apache HTTP Server SAP Sybase OData Server SQL Anywhere Database 4

HOSTING THE SAP SYBASE ODATA SERVER Launching the SAP Sybase OData Server The following steps illustrate how to configure and launch the SAP Sybase OData Server to interface with the demo database that is provided in the SQL Anywhere installation and process OData requests: 1. Create a directory to contain the server configuration file and log files. The rest of this document assumes ODATA_HOME is the full path of this directory. 2. Copy the corresponding files that are listed in the appendix to ODATA_HOME: odata_config.properties This Properties file configures the SAP Sybase OData Server. This file defines a number of OData Server behaviors and provides the details necessary to connect to the SQL Anywhere database server. odata.osdl This OData Service Definition Language file provides the OData Server with additional information regarding how to expose the schema of the SQL Anywhere sample database. 3. Start the SAP Sybase OData Server by running the following command from the ODATA_HOME directory: SQLANY_HOME/Bin64/dbosrv16.exe odata_config.properties 4. Verify that the servlet loaded successfully by visiting the following URL in a web browser: http://localhost:8080/odata/$metadata. An XML document describing the OData service schema appears. Setting up the Apache HTTP Server The following steps illustrate how to configure the Apache HTTP Server to proxy OData requests to the SAP Sybase OData Server. After completing these steps, you should have a functioning HTTP Server that is able to accept web requests, and proxy any requests to the /odata path through to the SAP Sybase OData Server. 1. Install the Apache HTTP Server according to the instructions provided in the distribution. The rest of this document assumes that APACHE_HOME is the full path to the root directory of the Apache HTTP Server installation. 2. Enable the mod_proxy module in the Apache HTTP Server to configure it as a proxy server. a. Open the APACHE_HOME/conf/httpd.conf file. b. Uncomment the following directives, or add them if they do not exist: LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so c. Add the ProxyPass directive below the LoadModule directives to configure the Apache HTTP Server to redirect incoming requests to the SAP Sybase OData Server: ProxyPass /odata http://localhost:8080/odata d. Add the ProxyPreserveHost directive below the ProxyPass directive to configure Apache to preserve the Host header value from the incoming request. This is required so that any URLs encoded in OData responses correctly point to the Apache server. ProxyPreserveHost On 3. Verify that requests to the /odata path are being correctly proxied to the SAP Sybase OData Server by visiting the following URL in a web browser: http://localhost:80/odata/$metadata An XML document describing the OData service schema appears 5

Setting up the Web Application The following steps illustrate how to set up the web application that uses the OData service: 1. Copy the web application files to a directory where they can be accessed and served by the Apache HTTP Server. a. Create a directory to contain the web application files. The rest of this document assumes APP_HOME is the full path of this directory. b. Copy the corresponding files that are listed in the appendix to APP_HOME: salesorders.html salesorders.js c. Copy datajs-1.0.3.js to APP_HOME/datajs-1.0.3.js. 2. Configure the Apache HTTP Server to serve the web application. a. Open the APACHE_HOME/conf/httpd.conf file. b. Add the following Alias and Directory directive to configure the Apache HTTP Server to serve the web application files from the /app URL path. Alias /app APP_HOME <Directory APP_HOME> Order allow,deny Allow from all </Directory> c. Restart the Apache HTTP Server. d. Visit http://localhost:80/app/salesorders.html in a web browser. The application becomes fully available. 6

APPENDIX salesorders.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <title>apache Sales Orders Sample</title> <script type='text/javascript' src='salesorders.js'></script> <script type='text/javascript' src='datajs-1.0.3.js'></script> <style type="text/css">.padding height: 30px; clear: both;.container width: 100%;.selectList float: left; width: 250px;.selectList select width: 200px;.display width: 400px; float: left; border: 1px solid #000; background-color: #ddd;.display dl width: 100%; padding: 10px; margin: 0px; float: left; font-size: 85%;.display dl dt width: 100px; clear: left; float: left; font-weight: bold; img border: 1px solid #000; width: 100px; height: 100px; position: relative; top: 10px; left: -110px; float: left; </style> </head> <body onload="loadcustomers()"> <div class="container"> <div class="selectlist" id="customerselectdiv"> <select size=10 id="customerselect" onchange="changeselectedcustomer( this.selectedindex );"> </select> <div class="display" id="customerdisplay"> <dl id="customerdetails"> </dl> 7

<div class="padding"> <div class="container"> <div class="selectlist" id="orderselectdiv"> <select size=5 id="orderselect" onchange="changeselectedsalesorder( this.selectedindex );"> </select> <div class="display" id="orderdisplay"> <dl id="orderdetails"> </dl> <div class="padding"> <div class="container"> <div class="selectlist" id="orderitemselectdiv"> <select size=5 id="orderitemselect" onchange="changeselectedsalesorderitem( this.selectedindex );"> </select> <div class="display" id="orderitemdisplay"> <dl id="orderitemdetails"> </dl> <img id="itemphoto"> </body> </html> 8

salesorders.js var customercache = []; var ordercache = []; var orderitemcache = []; var customerdisplayprops = [ "ID", "GivenName", "Surname", "Street", "State", "PostalCode", "Phone", "Company" ]; var ordersdisplayprops = [ "ID", "Region", "OrderDate" ]; var orderitemsdisplayprops = [ "ID", "Region", "OrderDate" ]; function loadcustomers() var uri = "/odata/customers"; OData.read( requesturi : uri, populatecustomerlist, error ); function loadsalesorders( selectedcustomerindex ) OData.jsonHandler.recognizeDates = true; if( selectedcustomerindex >= 0 ) var customerid = customercache[selectedcustomerindex]["id"]; var uri = "/odata/customers(" + customerid + ")?$expand=salesorders"; OData.read( requesturi : uri, populatesalesorderlist, error ); function loadsalesorderitems( selectedorderindex ) if( selectedorderindex >= 0 ) var orderid = ordercache[selectedorderindex]["id"]; var uri = "/odata/salesorders(" + orderid + ")?$expand=salesorderitems/fk_productid_id"; OData.read( requesturi : uri, populatesalesorderitemslist, error ); function populatecustomerlist( response, request ) var customerselect = document.getelementbyid( 'customerselect' ); // Remove any existing options customerselect.options.length = 0; // Update the customer cache with the new customer list customercache = response.results; // Add the new customer list to the select input for( var i=0; i<customercache.length; i++ ) var customername = customercache[i]['givenname'] + ' ' + customercache[i]['surname']; customerselect.options[i] = new Option( customername, i, i==0, i==0 ); changeselectedcustomer( customerselect.selectedindex ); function populatesalesorderlist( response, request ) var orderselect = document.getelementbyid( 'orderselect' ); // Remove the existing options orderselect.options.length = 0; // Update the order cache with the new order list ordercache = response.salesorders.results; // Add the new order list to the select input for( var i=0; i<ordercache.length; i++ ) var orderid = ordercache[i]['id']; orderselect.options[i] = new Option( 'OrderID: ' + orderid, i, i==0, i==0 ); changeselectedsalesorder( orderselect.selectedindex ); function populatesalesorderitemslist( response, request ) var itemselect = document.getelementbyid( 'orderitemselect' ); // Remove the existing options itemselect.options.length = 0; 9

// Update the order cache with the new order list orderitemcache = response.salesorderitems.results; // Add the new order list to the select input for( var i=0; i<orderitemcache.length; i++ ) var linenum = orderitemcache[i]['lineid']; itemselect.options[i] = new Option( 'Line ID : ' + linenum, i, i==0, i==0 ); changeselectedsalesorderitem( itemselect.selectedindex ); function changeselectedcustomer( selectedcustomerindex ) if( selectedcustomerindex >= 0 ) var customer = customercache[ selectedcustomerindex ]; var detailsview = document.getelementbyid( "customerdetails" ); detailsview.innerhtml = "" + "<dt>id:</dt>" + "<dd>" + customer.id + "</dd>" + "<dt>name:</td>" + "<dd>" + customer.givenname + " " + customer.surname + "</dd>" + "<dt>address:</td>" + "<dd>" + customer.street + ", " + customer.city + ", " + customer.state + "</dd>" + "<dt>phone:</td>" + "<dd>" + customer.phone + "</dd>" + "<dt>company:</td>" + "<dd>" + customer.companyname + "</dd>" ; loadsalesorders( selectedcustomerindex ); function changeselectedsalesorder( selectedorderindex ) if( selectedorderindex >= 0 ) var order = ordercache[ selectedorderindex ]; var detailsview = document.getelementbyid( "orderdetails" ); detailsview.innerhtml = "" + "<dt>order ID:</dt>" + "<dd>" + order.id + "</dd>" + "<dt>region:</td>" + "<dd>" + order.region + "</dd>" + "<dt>order Date:</td>" + "<dd>" + order.orderdate + "</dd>" ; loadsalesorderitems( selectedorderindex ); function changeselectedsalesorderitem( selectedorderitemindex ) if( selectedorderitemindex >= 0 ) var item = orderitemcache[ selectedorderitemindex ]; var detailsview = document.getelementbyid( "orderitemdetails" ); detailsview.innerhtml = "" + "<dt>line ID:</td>" + "<dd>" + item.lineid + "</dd>" + "<dt>quantity:</td>" + "<dd>" + item.quantity + "</dd>" + "<dt>name:</td>" + "<dd>" + item.fk_productid_id.name + "</dd>" + "<dt>description:</td>" + "<dd>" + item.fk_productid_id.description + "</dd>" + "<dt>size:</td>" + "<dd>" + item.fk_productid_id.size + "</dd>" + "<dt>color:</td>" + "<dd>" + item.fk_productid_id.color + "</dd>" + "<dt>unit Price:</td>" + "<dd>$" + item.fk_productid_id.unitprice + "</dd>" ; var itemphoto = document.getelementbyid( "itemphoto" ); itemphoto.src = "data:image/jpeg;base64, " + item.fk_productid_id.photo; 10

function error( err ) alert( 'An error occurred: (' + err.response.statuscode + ') ' + err.response.body ); 11

odata_config.properties #Data Producer options # ---------------------- # Use the OSDL file to model the schema of the EmployeeConfidential materialized view Model = odata.osdl # Provide an optional connection string used to validate the OSDL file on startup # (This option should be used during development only, and removed for production deployment) ModelConnectionString = DSN=SQL Anywhere 16 Demo # Configure the logging LogVerbosity = 2 LogFile = odata.log # Set the OData server to listen on a specific port ServerPort = 8080 # Database connection parameters # ------------------------------ # Connect to a SQLAnywhere Database DbProduct = sqlanywhere # Disable database authentication. Credentials are provided by the DSN Authentication = none # Use the SQLAnywhere demo database as the data source DbConnectionString = DSN=SQL Anywhere 16 Demo 12

odata.osdl service namespace "HttpsSample" "GROUPO"."Employees"; "GROUPO"."Departments"; "GROUPO"."Customers"; "GROUPO"."SalesOrders"; "GROUPO"."SalesOrderItems"; "GROUPO"."Products"; 13

www.sap.com 2013 SAP AG or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.