Working With Web Services From ABAP PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

SDN Meets Labs, Palo Alto, California April 7-8, 2005

Kimball International: Working with WebServices from ABAP


Thomas Jung

Learning Points
Learn how to create a WebService using ABAP Learn how to consume a WebService using ABAP See Real World Examples of this technology

WebAS Technology Overview


What if I have R/3 4.6C or lower?
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 46C Unix/Oracle

QAS: R/3 46C Unix/Oracle

Prod: R/3 46C Unix/Oracle

Dev: WebAS 640 Win2K/MSSQL

QAS: WebAS 640 Win2K/MSSQL

Prod: WebAS 640 Win2K/MSSQL

Creating WebServices 620


Start with any Remote Enabled Function Module

Creating WebServices 620


Follow similar rules to creating a BAPI
Avoid Exceptions Instead Return a Message Structure (BAPIRET2) Run Dark Avoid anything that would trigger a Screen (Short Dump: DYNPRO_SEND_IN_BACKGROUND)

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 Exceptions We built a table to store RFC Destinations per function

Creating WebServices 620


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

Creating WebServices 620


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

Creating WebServices 620


Pro: Very Quick and Easy to expose RFC as WebService Con: No Control over individual WebServices Con: Cant set security per WebService Con: All Remote Enabled Functions are Automatically Exposed as WebServices

Creating WebServices 640


We still start with an RFC Follow the same rules as before for Creating the RFC

Creating WebServices 640


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

Creating WebServices 640


Rename or Reduce Elements via the Virtual Interface

Creating WebServices 640


Register Object Screen??? (640 SP10)

Creating WebServices 640


Create the WebService Definition itself

Creating WebServices 640


WebService Features

Creating WebServices 640


WebService Features

Creating WebServices 640


WebService Features

Creating WebServices 640


Publish TModel to a UDDI

Creating WebServices 640


Release our WebService (WSCONFIG)

Creating WebServices 640


Administer our WebService (WSADMIN)

10

Creating WebServices 640


WebService Home Page

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

11

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

Calling WebServices 620


HTTP Client approach z_e_rfc_ws_send_sms_webtel.txt

12

Calling WebServices 640


Creating a Client Proxy

Calling WebServices 640


Generated Class and Structures

13

Calling WebServices 640


Logical Port

Calling WebServices 640


Coding against the Proxy Class ZESU_OLD_DIR_WS_CLIENT_TEST.txt

14

Exposed WebService Example


Shop Floor Interfaces
Expose BAPI BAPI_REPMANCONF1_CREATE_MTS Need to support Mixed Code Pages (Latin-1 & Latin-2) Run Over WAN US->Poland Be Near Real Time Basic Authentication ->HTTPS Latency ->qRFC Duplicate Records -> GUID

Calling WebService Example


Corp. Global Directory
UDDI Integration Reuse across platforms (.Net and NetWeaver) WebService Interoperability xsi:nil="true" inside complex Structures

15

Resources
BSP a Developers Journal Part XIII: Developing ABAP WebServices BSP a Developer's Journal Part XIV - Consuming WebServices with ABAP Publishing ABAP WebServices to an External UDDI Server Develop a Web Service that sends an Email - in ABAP WebServices: A real world implementation experience

16

You might also like