Top Banner
Session ID: CD215 Working with WebServices from ABAP
52
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Web Service 1

Session ID: CD215Working with WebServices from ABAP

Page 2: Web Service 1

Thomas Jung, Kimball Electronics Group

Page 3: Web Service 1

Calling WebServices 620

Calling WebServices 640

Creating WebServices 620

Creating WebServices 640

Page 4: Web Service 1

© 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

Page 5: Web Service 1

© 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

Page 6: Web Service 1

© SAP TechEd ’05 / CD215 / 6

Creating WebServices 620

Start with any Remote Enabled Function Module

Page 7: Web Service 1

© 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)

Page 8: Web Service 1

© 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

Page 9: Web Service 1

© SAP TechEd ’05 / CD215 / 9

Creating WebServices 620

WebService Browser: bc/bsp/sap/webservicebrowser/search.htm

Page 10: Web Service 1

© SAP TechEd ’05 / CD215 / 10

Creating WebServices 620

With the generated WSDL, we can now easily consume in another Development Environment

Page 11: Web Service 1

© SAP TechEd ’05 / CD215 / 11

Creating WebServices 620

Security and Connectivity Settings are controlled by a single ICM Node/default_host/sap/bc/soap

Page 12: Web Service 1

© SAP TechEd ’05 / CD215 / 12

Creating WebServices 620

Logon Language Processing

Page 13: Web Service 1

© 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

Page 14: Web Service 1

Calling WebServices 620

Calling WebServices 640

Creating WebServices 620

Creating WebServices 640

Page 15: Web Service 1

© SAP TechEd ’05 / CD215 / 15

Creating WebServices 640

We still start with an RFC

Follow the same rules as before for Creating the RFC

Page 16: Web Service 1

© SAP TechEd ’05 / CD215 / 16

Creating WebServices 640

Create a Virtual InterfaceCan be created off of a BAPI, Function Module, or Function Group

Page 17: Web Service 1

© SAP TechEd ’05 / CD215 / 17

Creating WebServices 640

Rename or Reduce Elements via the Virtual Interface

Page 18: Web Service 1

© SAP TechEd ’05 / CD215 / 18

Creating WebServices 640

Register Object Screen Bug (640 SP11 and lower)

Page 19: Web Service 1

© SAP TechEd ’05 / CD215 / 19

Demo

Demo

Page 20: Web Service 1

© SAP TechEd ’05 / CD215 / 20

Creating WebServices 640

Create the WebService Definition itself

Page 21: Web Service 1

© SAP TechEd ’05 / CD215 / 21

Creating WebServices 640

WebService Features

Page 22: Web Service 1

© SAP TechEd ’05 / CD215 / 22

Creating WebServices 640

WebService Features

Page 23: Web Service 1

© SAP TechEd ’05 / CD215 / 23

Creating WebServices 640

WebService Features

Page 24: Web Service 1

© SAP TechEd ’05 / CD215 / 24

Creating WebServices 640

Publish TModel to a UDDI

Page 25: Web Service 1

© SAP TechEd ’05 / CD215 / 25

Demo

Demo

Page 26: Web Service 1

© SAP TechEd ’05 / CD215 / 26

Creating WebServices 640

Release our WebService (WSCONFIG)

Page 27: Web Service 1

© SAP TechEd ’05 / CD215 / 27

Demo

Demo

Page 28: Web Service 1

© SAP TechEd ’05 / CD215 / 28

Creating WebServices 640

Administer our WebService (WSADMIN)

Page 29: Web Service 1

© SAP TechEd ’05 / CD215 / 29

Creating WebServices 640

WebService Navigator

Page 30: Web Service 1

© SAP TechEd ’05 / CD215 / 30

Creating WebServices 640

WebService Home Page

Page 31: Web Service 1

© SAP TechEd ’05 / CD215 / 31

Demo

Demo

Page 32: Web Service 1

© SAP TechEd ’05 / CD215 / 32

Creating WebServices 640

Logon Language Processing

Page 33: Web Service 1

© 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).

Page 34: Web Service 1

Calling WebServices 620

Calling WebServices 640

Creating WebServices 620

Creating WebServices 640

Page 35: Web Service 1

© 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

Page 36: Web Service 1

© 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

Page 37: Web Service 1

© SAP TechEd ’05 / CD215 / 37

Calling WebServices 640

Client Certificates

Page 38: Web Service 1

Calling WebServices 620

Calling WebServices 640

Creating WebServices 620

Creating WebServices 640

Page 39: Web Service 1

© SAP TechEd ’05 / CD215 / 39

Calling WebServices 640

Creating a Client Proxy

Page 40: Web Service 1

© SAP TechEd ’05 / CD215 / 40

Calling WebServices 640

Generated Class and Structures

Page 41: Web Service 1

© SAP TechEd ’05 / CD215 / 41

Demo

Demo

Page 42: Web Service 1

© SAP TechEd ’05 / CD215 / 42

Calling WebServices 640

Logical Port

Page 43: Web Service 1

© SAP TechEd ’05 / CD215 / 43

Calling WebServices 640

Coding against the Proxy Class

ZESU_OLD_DIR_WS_CLIENT_TEST.txt

Page 44: Web Service 1

© SAP TechEd ’05 / CD215 / 44

Calling WebServices 640

HTTPS Based WebService Calls – Logical Port Setup

Page 45: Web Service 1

© SAP TechEd ’05 / CD215 / 45

Calling WebServices 640

HTTPS Based WebService Calls – RFC Setup

Page 46: Web Service 1

© 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

Page 47: Web Service 1

© SAP TechEd ’05 / CD215 / 47

qRFC with WebServices

Page 48: Web Service 1

© SAP TechEd ’05 / CD215 / 48

Calling WebService Example

Corp. Global DirectoryUDDI IntegrationReuse across platforms (.Net and NetWeaver)WebService Interoperabilityxsi:nil="true" inside complex Structures

Page 49: Web Service 1

© 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

Page 50: Web Service 1

© SAP TechEd ’05 / CD215 / 50

Q&A

Questions?

Page 51: Web Service 1

© 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 !

Page 52: Web Service 1

© 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.