Integrating a Web Service in a Composite Application. SAP Composite Application Framework

Similar documents
SAP Composite Application Framework. Creating a Content Package Object

How To... Reuse Business Objects and Override Operations of a Business Object

SAP Composite Application Framework. Creating an External Service type Callable Object in Guided Procedures

How To Set up NWDI for Creating Handheld Applications in SAP NetWeaver Mobile 7.1

How to Use Function Keys in Mobile Applications for Handhelds

SAP Composite Application Framework. Creating a Callable Object in Group: Miscellaneous

SAP NetWeaver How-To Guide

How To...Configure Integration of CUP with SPM

How To... Promote Reports and Input Schedules Through Your System Landscape

Authentication of a WS Client Using a SAP Logon Ticket

Using Business Graphics

How To... Master Data Governance for Material: BADI USMD_SSW_SYSTEM_METHOD_CALLER to create successor change request

How To... Configure Integrated Configurations in the Advanced Adapter Engine

How To Recover Login Module Stack when login to NWA or Visual Administrator is impossible

How To... Master Data Governance for Material: BADI USMD_SSW_PARA_RESULT_HANDLER to merge result of parallel workflow tasks

Simplified Configuration of Single System Update in Maintenance Optimizer

How To...Use a Debugging Script to Easily Create a Test Environment for a SQL-Script Planning Function in PAK

How To... Master Data Governance for Material: File Down- and Upload

Install TREX for CAF Version 1.00 March 2006

How-To... Add Sensitive Content into an Area

SAP NetWeaver How-To Guide

What s New / Release Notes SAP Strategy Management 10.1

Do Exception Broadcasting

SAP NetWeaver How-To Guide How to use Process Execution Manager Using SAP Test Data Migration Server

MDM Syndicator Create Flat Syndication File

How To...Custom BADI for rounding off values in SAP BUSINESSOBJECTS Planning and Consolidation, version for SAP NetWeaver.

Transport in GP. How-to Guide Beginning with SAP NetWeaver 2004s SPS06. Version 2.00 January 2006

Web Dynpro for ABAP: Tutorial 4 - Display Bookings of Selected Flight

How To... Configure Drill Through Functionality

Setting Up an Environment for Testing Applications in a Federated Portal Network

How To Customize the SAP User Interface Using Theme Editor

How To Generate XSD Schemas from Existing MDM Repositories

configure an anonymous access to KM

SAP BW 3.3 April 2004 English. General Ledger Analysis. Business Process Procedure. SAP AG Neurottstr Walldorf Germany

Consuming Web Dynpro components in Visual Composer.

How to Upgr a d e We b Dynpro Them e s from SP S 9 to SP S 1 0

SAP NetWeaver How-To Guide. SAP NetWeaver Gateway Virtualization Guide

Visual Composer - Task Management Application

How to Install SAP Netweaver 2004s ABAP Edition on Your Local PC

Access Control 5.3 Implementation Considerations for Superuser Privilege Management ID-Based Firefighting versus Role-Based Firefighting Applies to:

How To Extend User Details

Creating Your First Web Dynpro Application

How to Create a New SAPUI5 Development Component

link SAP BPC Excel from an enterprise portal Version th of March 2009

How To Configure the Websocket Integration with SAP PCo in SAP MII Self Service Composition Environment Tool

SAP GRC Access Control: Configuring compliant user provisioning (formerly Virsa Access Enforcer) into CUA Systems

A Step-By-Step Guide on File to File Scenario Using Xslt Mapping

SAP - How-To Guide MDG Custom Object Data Replication How to Configure Data Replication for MDG Custom Objects (Flex Option)

How to Browse an Enterprise Services Registry in Visual Composer

How To Integrate the TinyMCE JavaScript Content Editor in Web Page Composer

How To... Use the BPC_NW Mass User Management Tool

Create Partitions in SSAS of BPC Version 1.00 Feb 2009

How to Set Up and Use the SAP OEE Custom UI Feature

How To Develop a Simple Web Service Application Using SAP NetWeaver Developer Studio & SAP XI 3.0

How to View Dashboards in the Self Service Composition Environment with Additional Metadata

SAP Centralized Electronic Funds Transfer 1.8

Data Validation in Visual Composer for SAP NetWeaver Composition Environment

Integrate a Forum into a Collaboration Room

Quick Reference Guide SAP GRC Access Control Compliant User Provisioning (formerly Virsa Access Enforcer): HR Triggers

Use Business Objects Planning and Consolidation (version for the Microsoft platform) BPF services in Xcelsius

How to Set Up and Use the SAP OEE Custom KPI Andons Feature

How To Troubleshoot SSL with BPC Version 1.01 May 2009

Cache Settings in Web Page Composer

Web Page Composer anonymous user access

How To Configure IDoc Adapters

Process Control 2.5 Implementation Checklist

How to do Breakdown Validation in SAP BPC 7.0 for the SAP NetWeaver Platform

Introducing SAP Enterprise Services Explorer for Microsoft.NET

Setup an NWDI Track for Composition Environment Developments

SAP NetWeaver 04 Security Guide. Operating System Security: SAP System Security Under Windows

Enterprise Portal Logon Page Branding

Visual Composer Build Process

Web Dynpro for ABAP: Tutorial 5 Component and Application Configuration

Configure SSO in an SAP NetWeaver 2004s Dual Stack

Configure UD Connect on the J2EE Server for JDBC Access to External Databases

How to Translate a Visual Composer Model Part I

How to Set Up Data Sources for Crystal Reports Layouts in SAP Business One, Version for SAP HANA

Building a Tax Calculation Application

Extract Archived data from R3

Installation Guide Business Explorer

How To Enable Business Workflow for SAP NetWeaver Gateway 2.0

Configure TREX 6.1 for Efficient Indexing. Document Version 1.00 January Applicable Releases: SAP NetWeaver 04

Visual Composer for NetWeaver CE: Getting Started with a Typical Workflow

Diagnostics Agent Installation in Unattended Mode with SWPM 1.0 SP5 for NetWeaver higher than 7.0x

Create Monitor Entries from an update routine

Work with Variables in SAP NetWeaver Visual Composer Version 1.00 May 2006

SOA Security Scenarios: WebAS Java, Message Level Security with no Transport Guarantee

SAP How-To Guide. Master Data Governance for Material. How To... Adjust MDG Homepage. Applicable Releases: EhP6, MDG 6.1

Configure Peripheral Drivers with Mobile Infrastructure

Sizing for Guided Procedures, SAP NetWeaver 7.0

SAP NetWeaver 04. Unification Terminology

How to Package and Deploy SAP Business One Extensions for Lightweight Deployment

How to Use Definitions in Rules Composer

Demand Management. Job Processing Guide for SAP DM. Release 6.4

Building a Composite Business Process from Scratch with SAP NetWeaver BPM Guide 2

Web Dynpro Java for Newbies: a Quick Guide to Develop Your First Application

The test has been performed using a 64 Bit SAP NetWeaver Application Server Java 7.1 Enhancement Package 1 SP4 or greater system.

How-to Guide SAP NetWeaver 04. Web Dynpro Themes. Version Applicable Releases: SAP NetWeaver 7.0

Exercise 1: Adding business logic to your application

How to Work with Analytical Portal

Transcription:

Integrating a Web Service in a Composite Application SAP Composite Application Framework Document Version 1.00 November 2005

SAP AG Neurottstraße 16 69190 Walldorf Germany T +49/18 05/34 34 24 F +49/18 05/34 34 20 www.sap.com Copyright 2005 SAP AG. 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. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iseries, pseries, xseries, zseries, z/os, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM Corporation in the United States and/or other countries. SAP, R/3, mysap, mysap.com, xapps, xapp, SAP NetWeaver, 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 in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. 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. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Disclaimer Some components of this product are based on Java. Any code change in these components may cause unpredictable and severe malfunctions and is therefore expressively prohibited, as is any decompilation of these components. Any Java Source Code delivered with this product is only to be used by SAP s Support Services and may not be modified or altered in any way. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden.

Typographic Conventions Type Style Represents Example Text Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options. Cross-references to other documentation. Example text Emphasized words or phrases in body text, graphic titles, and table titles. EXAMPLE TEXT Technical names of system objects. These include report names, program names, transaction codes, table names, and key concepts of a programming language when they are surrounded by body text, for example, SELECT and INCLUDE. Example text Output on the screen. This includes file and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools. Example text Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation. <Example text> Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system. EXAMPLE TEXT Keys on the keyboard, for example, F2 or ENTER. Icons Icon Meaning Caution Example Note Recommendation Syntax

Contents Introduction... 2 About This Document... 2 Prerequisites... 2 Disclaimer... 2 Create the Development Component Project... 2 Import a Web Service as an External Service... 5 Encapsulate the Web Service in an Entity Service... 8 Runtime External Service Configuration... 14 Test the External Service... 17

Introduction About This Document This tutorial is a part of a series that describes how to implement a composite application using SAP Composite Application Framework (CAF) capabilities. The tutorial describes how to integrate a Web service as an external service in your composite application using the capabilities of the CAF Service and UI layer. Prerequisites The following table describes the prerequisites for running this tutorial. Software The tutorial is compliant with: Documents Sneak Preview SAP NetWeaver 04 Web Application Server 6.40 Java. You can download the sneak preview at http://sdn.sap.com SAP NetWeaver 2004s SPS04 Before you start with this tutorial, see: Creating a Local Entity with Maintenance UI Disclaimer Any software coding and/or code lines / strings ("Code") included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent. Create the Development Component Project... 1. Launch the SAP NetWeaver Developer Studio. 2. Chose Window Open Perspective Other... Composite Application Services. 3. Navigate to File New Project and choose to create a new development component project. Choose Next.

4. Select Local Development MyComponents and choose Next.

This tutorial does not describe development using the SAP NetWeaver Development Infrastructure (NWDI). For more information about NWDI, see the relevant documentation available in the SAP NetWeaver Developer s Guide at http://sdn.sap.com/irj/sdn/developersguide. 5. In the next screen, enter the following data, and then choose Next. Field Name Caption Domain Type Value user_example (use only small letters) User Example Application SAP xapps Composite Application Services 6. Choose Next again. You see a list of the projects that are generated as a part of your development component (DC). 7. To complete the procedure, choose Finish.

You see the new project in the Service Explorer view. Import a Web Service as an External Service... 1. In the Service Explorer view, select <your project name> External Services, and open the context menu using the secondary mouse button. 2. Choose Import. 3. Select the option Web Service and choose Next.

4. Select Local File System or URL as the source system for the Web service metadata. Choose Next. 5. Set the WSDL to the following URL: http://<host>:<port>/edmfoundationws/default?wsdl For example, http://localhost:53000/edmfoundationws/default?wsdl.

6. Choose Finish. 7. In the Service Explorer view, select the new external service and double click to open it. 8. Switch to the Operations tab page and select the function getallemployees, for example.

You can enter a description of the function in the right-hand cell. A list of all input and output parameters is displayed as well. To save the changes that you have done, choose File Save all metadata. Encapsulate the Web Service in an Entity Service... To use this external service, you must encapsulate it in an entity service. 1. Select <your project name> Entity Services, and open its context menu using the secondary mouse button. 2. Choose New.

3. Enter a name for the entity service, and choose Finish.

4. To create the necessary attributes for the entity service, switch to the Attributes tab, open the context menu with the secondary mouse button, and choose Create Attribute. 5. Enter firstname for the name, and First Name for the description of the new attribute, and choose Finish. 6. Repeat the above steps to add the following attributes: Field Name Data Type Description Key pers_no com.sap.caf.core.long Employee number Yes firstname com.sap.caf.core.long First Name Text lastname com.sap.caf.core.long Last Name Text id com.sap.caf.core.shor User Id

ttext 7. Switch to the Operations tab page and choose Add. 8. Enter the following data: Operation name: getuserdetailbyid Descriptio: Gets all user details by its ID

9. Switch to the Persistency tab page and disable the option Local Persistency. This is required sp that the operation can be mapped to external services. 10. Switch to the Datasource tab page and select the getuserdetailbyid operation. In the righthand cell, choose (Select) to map the operation to an external service.

11. Select the getemployee service and choose OK. 12. Now you can define the parameter mapping by selecting an entity service parameter and dragging the cursor to select the relevant external operation parameter. You must map the parameters as follows: Entity Service Parameter Input Id minvalue Output Result pers_no Output Result firstname Output Result lastname External Operation Parameter Input parameters getemployee employeeid Output parameters getemployee employeeid Output parameters getemployee firstname Output parameters getemployee lastname

Output Result id Output parameters getemployee email 13. Switch to the Permissions tab page and disable the option Permission checks enabled. Save the metadata, build the project and deploy it. Runtime External Service Configuration... 1. Open the CAF Runtime Configuration page using the following URL: http://<host>:<port>/caf http://localhost:53000/caf 2. Then choose Administrative Tools.

3. Now choose External Service Configuration. 4. Choose Service Registry on the left. In the service registry you can define and maintain the backend connections for your external services.

5. Select the external service you have created and choose Open Definition. 6. Select the root node of the external operation (the Web service itself). 7. Under Service Configuration, enter the WSDL description URL as follows, and then choose Save. http://<host>:<port>/edmfoundationws/default?wsdl http://localhost:53000/edmfoundationws/default?wsdl

... 8. Now select the function node of the external operation getemployee. 9. Enter the endpoint URL as follows, and then choose Save: http://<host>:<port>/edmfoundationws/default?style=document http://localhost:53000/edmfoundationws/default?style=document Test the External Service You can test an external services using the entity service you create to encapsulate the external one. Therefore, testing an external service is similar to testing an entity. 1. Open the CAF Runtime Configuration page: http://<host>:<port>/caf 2. Choose Test tools.

3. Choose Service Browser. 4. Navigate to the getuserdetailbyid operation.

5. Enter a valid user ID (for example, 25) and choose Execute query. The user details are displayed in a table.