Session ID: CD215 Working with WebServices from ABAP
Session ID: CD215Working with WebServices from ABAP
Thomas Jung, Kimball Electronics Group
Calling WebServices 620
Calling WebServices 640
Creating WebServices 620
Creating WebServices 640
© SAP TechEd ’05 / CD215 / 4
Learning Objectives
As a result of this workshop, you will be able to:create a WebService using ABAPconsume a WebService using ABAPLearn from Real World Examples of this technology
© SAP TechEd ’05 / CD215 / 5
Landscape Original
Prod R/3: HP-UX – 2 Servers: Quad PA8600 CPUs 32Gigs of Memory each
Prod WebAS: Compaq Proliant – Single Server: Dual 2.8Ghz Xeons with 4 Gigs of Memory
Dev: R/3 46CUnix/Oracle
Dev: WebAS 620Win2K/MSSQL
QAS: R/3 46CUnix/Oracle
QAS: WebAS 620Win2K/MSSQL
Prod: R/3 46CUnix/Oracle
Prod: WebAS 620Win2K/MSSQL
© SAP TechEd ’05 / CD215 / 6
Creating WebServices 620
Start with any Remote Enabled Function Module
© SAP TechEd ’05 / CD215 / 7
Creating WebServices 620
Follow similar rules to creating a BAPIAvoid Exceptions – Instead Return a Message Structure (BAPIRET2)Run Dark – Avoid anything that would trigger a Screen (Short Dump: DYNPRO_SEND_IN_BACKGROUND)
© SAP TechEd ’05 / CD215 / 8
Creating WebServices 620
RFC in 620 system might just be a wrapper for an R/3 Function running on an Older Release
z_e_rfc_ws_get_plant_values.txt
Be sure to catch any Remote ExceptionsWe built a table to store RFC Destinations per function
© SAP TechEd ’05 / CD215 / 9
Creating WebServices 620
WebService Browser: bc/bsp/sap/webservicebrowser/search.htm
© SAP TechEd ’05 / CD215 / 10
Creating WebServices 620
With the generated WSDL, we can now easily consume in another Development Environment
© SAP TechEd ’05 / CD215 / 11
Creating WebServices 620
Security and Connectivity Settings are controlled by a single ICM Node/default_host/sap/bc/soap
© SAP TechEd ’05 / CD215 / 12
Creating WebServices 620
Logon Language Processing
© SAP TechEd ’05 / CD215 / 13
Creating WebServices 620
Pro: Very Quick and Easy to expose all RFCs as WebServices
Con: No Control over individual WebServices
Con: Can’t set security per WebService
Con: All Remote Enabled Functions are Automatically Exposed as WebServices
Calling WebServices 620
Calling WebServices 640
Creating WebServices 620
Creating WebServices 640
© SAP TechEd ’05 / CD215 / 15
Creating WebServices 640
We still start with an RFC
Follow the same rules as before for Creating the RFC
© SAP TechEd ’05 / CD215 / 16
Creating WebServices 640
Create a Virtual InterfaceCan be created off of a BAPI, Function Module, or Function Group
© SAP TechEd ’05 / CD215 / 17
Creating WebServices 640
Rename or Reduce Elements via the Virtual Interface
© SAP TechEd ’05 / CD215 / 18
Creating WebServices 640
Register Object Screen Bug (640 SP11 and lower)
© SAP TechEd ’05 / CD215 / 19
Demo
Demo
© SAP TechEd ’05 / CD215 / 20
Creating WebServices 640
Create the WebService Definition itself
© SAP TechEd ’05 / CD215 / 21
Creating WebServices 640
WebService Features
© SAP TechEd ’05 / CD215 / 22
Creating WebServices 640
WebService Features
© SAP TechEd ’05 / CD215 / 23
Creating WebServices 640
WebService Features
© SAP TechEd ’05 / CD215 / 24
Creating WebServices 640
Publish TModel to a UDDI
© SAP TechEd ’05 / CD215 / 25
Demo
Demo
© SAP TechEd ’05 / CD215 / 26
Creating WebServices 640
Release our WebService (WSCONFIG)
© SAP TechEd ’05 / CD215 / 27
Demo
Demo
© SAP TechEd ’05 / CD215 / 28
Creating WebServices 640
Administer our WebService (WSADMIN)
© SAP TechEd ’05 / CD215 / 29
Creating WebServices 640
WebService Navigator
© SAP TechEd ’05 / CD215 / 30
Creating WebServices 640
WebService Home Page
© SAP TechEd ’05 / CD215 / 31
Demo
Demo
© SAP TechEd ’05 / CD215 / 32
Creating WebServices 640
Logon Language Processing
© SAP TechEd ’05 / CD215 / 33
Migration 620->640
Very Easy to do
Converted 28 function modules into 12 separate VI/WebServices in about 2 hours (Includes registration into our Corp. UDDI).
Calling WebServices 620
Calling WebServices 640
Creating WebServices 620
Creating WebServices 640
© SAP TechEd ’05 / CD215 / 35
Calling WebServices 620
No Client Proxy Generation!
One Solution: by pass SOAP and call directly using HTTP Client Functionality
Use SAP delivery SOAP Classes: not forward compatible with 640
© SAP TechEd ’05 / CD215 / 36
Calling WebServices 620
HTTP Client approach
z_e_rfc_ws_send_sms_webtel.txt
ZCL_ES_SHARED_MEM_WEATHER_COM__CALL_WEBSERVICE.abap
© SAP TechEd ’05 / CD215 / 37
Calling WebServices 640
Client Certificates
Calling WebServices 620
Calling WebServices 640
Creating WebServices 620
Creating WebServices 640
© SAP TechEd ’05 / CD215 / 39
Calling WebServices 640
Creating a Client Proxy
© SAP TechEd ’05 / CD215 / 40
Calling WebServices 640
Generated Class and Structures
© SAP TechEd ’05 / CD215 / 41
Demo
Demo
© SAP TechEd ’05 / CD215 / 42
Calling WebServices 640
Logical Port
© SAP TechEd ’05 / CD215 / 43
Calling WebServices 640
Coding against the Proxy Class
ZESU_OLD_DIR_WS_CLIENT_TEST.txt
© SAP TechEd ’05 / CD215 / 44
Calling WebServices 640
HTTPS Based WebService Calls – Logical Port Setup
© SAP TechEd ’05 / CD215 / 45
Calling WebServices 640
HTTPS Based WebService Calls – RFC Setup
© SAP TechEd ’05 / CD215 / 46
Exposed WebService Example
Shop Floor InterfacesExpose BAPI BAPI_REPMANCONF1_CREATE_MTSNeed to support Mixed Code Pages (Latin-1 & Latin-2)Run Over WAN US->PolandBe Near Real TimeBasic Authentication ->HTTPSLatency ->qRFCDuplicate Records -> GUID
© SAP TechEd ’05 / CD215 / 47
qRFC with WebServices
© SAP TechEd ’05 / CD215 / 48
Calling WebService Example
Corp. Global DirectoryUDDI IntegrationReuse across platforms (.Net and NetWeaver)WebService Interoperabilityxsi:nil="true" inside complex Structures
© SAP TechEd ’05 / CD215 / 49
Further Information
Public Web:www.sdn.sap.com
BSP – a Developer’s Journal Part XIII: Developing ABAP WebServicesBSP a Developer's Journal Part XIV - Consuming WebServices with ABAPPublishing ABAP WebServices to an External UDDI ServerDevelop a Web Service that sends an Email - in ABAPWebServices: A real world implementation experienceCalling WebServices from ABAP via HTTPSABAP WebServices: Logon Language ProcessingWeb Services: The Case of the Missing SOAP Action HeaderWebService Navigator Page for ABAP and Java
SAP NetWeaver Developer‘s Guide: www.sdn.sap.com/sdn/developersguide.sdn
Related Workshops/Lectures at SAP TechEd ’05CD153, Providing and Consuming Web Services in ABAP, Hands-On
© SAP TechEd ’05 / CD215 / 50
Q&A
Questions?
© SAP TechEd ’05 / CD215 / 51
Please complete your session evaluation.
Be courteous — deposit your trash, and do not take the handouts for the following session.
Feedback
Thank You !
© SAP TechEd ’05 / CD215 / 52
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.
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.
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.
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.
The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, or transmitted in any form or for any purpose without the express prior written permission of SAP AG.
This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. This document contains only intended strategies, developments, and functionalities of the SAP® product and is not intended to be binding upon SAP to any particular course of business, product strategy, and/or development. Please note that this document is subject to change and may be changed by SAP at any time without notice.
SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or completeness of the information, text, graphics, links, or other items contained within this material. This document is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.
SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. This limitation shall not apply in cases of intent or gross negligence.
The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages.