Vous êtes sur la page 1sur 25

SAP Flashbook

Providing Web Services Part 1 Author: Susanne Rothaug

This e-learning session contains narration!

Objectives
After completing this session, you will be able to:

Use the Web Service Creation Wizard to create a Web service Manually create and edit a Virtual Interface

SAP AG 2003, Title of Presentation, Speaker Name / 2

Creating a Web Service


in less than ONE minute

1
Implement Business Application
No Web service specific programming New or existing applications Defines standard interfaces Well known programming models

WS Configuration WS Definition Virtual Interface

2
Generate Web Service
Wizard based approach Based on preconfigured profiles Based on abstract behaviour Available for ABAP & Java

3
Activate / Deploy Web Service
Deployment in Java Activation in ABAP

SAP AG 2003, Title of Presentation, Speaker Name / 3

The Web Service Creation Wizard - Background -

Out-of-the-box Web services enablement of SAP solutions

Allows to expose an existing endpoint as a Web Service with a few mouse-clicks


Only shows the most important settings in the wizard
Default

values (profiles) for other settings

Hides technical details Implicitly creates all necessary objects

SAP AG 2003, Title of Presentation, Speaker Name / 4

The Web Service Creation Wizard - 1 -

EJB CreditLimitBean

Web Services Perspective

SAP AG 2003, Title of Presentation, Speaker Name / 5

The Web Service Creation Wizard - 2 -

SAP AG 2003, Title of Presentation, Speaker Name / 6

The Web Service Creation Wizard - 3 -

SAP AG 2003, Title of Presentation, Speaker Name / 7

The Web Service Creation Wizard - 4 -

Virtual Interface
Web Service Definition

Specify EAR Project

SAP AG 2003, Title of Presentation, Speaker Name / 8

The Web Service Creation Wizard - 5 -

Choose OK

Build AR File

Choose Deploy to J2EE Engine


SAP AG 2003, Title of Presentation, Speaker Name / 9

The Web Service Navigator

New Web service

SAP AG 2003, Title of Presentation, Speaker Name / 10

The Web Service Navigator

is part of SAP NetWeaver Developer Studio shows deployed Web services from different servers (SAP and Non SAP) is the starting point for the Web Service Homepage

can be used as starting point for Web Service Proxy generation

SAP AG 2003, Title of Presentation, Speaker Name / 11

The Web Service Homepage

is available for each deployed Web Service shows the documentation for the Web Service allows to retrieve WSDL descriptions in different styles allows to generate standalone proxies offers testing capabilities can be used to test SAP and NON-SAP Web services

SAP AG 2003, Title of Presentation, Speaker Name / 12

The Web Service Homepage: Test a Web Service


Choose Test Click on method name

URL of WSDL

Response: OK

Enter idCategory and idNumber

SAP AG 2003, Title of Presentation, Speaker Name / 13

Creating a Web Service Step-by-Step

The Step-by-Step approach


Create all objects by hand Full flexibility and options More expenses but still configuration only

SAP AG 2003, Title of Presentation, Speaker Name / 14

Creating a Web Service step by step for individual needs 1


Implement Business Application
No Web service specific programming New or existing applications Defines standard interfaces Well known programming models

2
Virtual Interface

Create Virtual Interface

Abstraction from Implemenatation

3
WS Definition

Create Web Service Definition

Defines abstract behaviour

WS Configuration

Configure Web Service

4
Individual Configuration of Security, Session,

5
Activate / Deploy Web Service
Deployment in Java Activation in ABAP

SAP AG 2003, Title of Presentation, Speaker Name / 15

Web Service Entities


Business Application
1:n

Application Layer

Virtual Interface 1

Virtual Interface 2 1:m

Virtual Interface n

Interface Views

WS Definition 1

WS Definition 2 1:p

WS Definition m

Abstract Behaviour

WS Configuration 1

WS Configuration 2 1:1

WS Configuration p

Concrete Configuration
Web Service

Web Service 1

Web Service 2

Web Service p

SAP AG 2003, Title of Presentation, Speaker Name / 16

Web Service Virtual Interface Background The Virtual Interface is the interface visible to clients (via WSDL, UDDI,)

A Virtual Interface

provides abstraction from concrete implementation (=endpoint)

allows to publish a view on existing implementations as Web Service Interfaces


i.e. renaming, hiding of parameters/methods, default values

allows to define how the Web Service Interface is represented in the SOAP message

SAP AG 2003, Title of Presentation, Speaker Name / 17

Web Service Virtual Interface Background <SOAP-ENV:Envelope> <SOAP-ENV:Body> <ns1:creditLimitCheck> <ns1:idNumber>1001</ns1:idNumber> </ns1:creditLimitCheck> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Request <SOAP-ENV:Envelope> Response <SOAP-ENV:Body> <rpl:creditLimitCheckResponse> <rpl:Response> <tns:score>980</tns:score> <tns:creditLimit>500000.00</tns:creditLimit> <tns:limitCurrency>USD</tns:limitCurrency> <tns:validTo>2005-01-01</tns:validTo> </rpl:Response> </rpl:creditLimitCheckResponse> </SOAP-ENV:Body> Rename </SOAP-ENV:Envelope>

Rename methods

Provide default values/ hide parameters

parameters

creditLimitCheck

Default Value: BUP001

idNumber (I)

score (O)

credit Limit (O)

limit Currency (O)

valid To (O)

Virtual Interface

FSCM_Cr_Limit_Check Implementation Layer

i_credit segment (I)

i_partner (I)

e_score (O)

e_limit (O)

e_currency (O)

e_valid_to (O)

SAP AG 2003, Title of Presentation, Speaker Name / 18

Create Virtual Interface - 1 -

Choose New Virtual Interface

SAP AG 2003, Title of Presentation, Speaker Name / 19

Create Virtual Interface 2 -

Select a package

Give a name to the VI

SAP AG 2003, Title of Presentation, Speaker Name / 20

Create Virtual Interface 3 -

Select or deselect methods

SAP AG 2003, Title of Presentation, Speaker Name / 21

Create Virtual Interface 4 -

New VI Method creditLimit Check

SAP AG 2003, Title of Presentation, Speaker Name / 22

Virtual Interface Edit Method

Remove method

Change method name

SAP AG 2003, Title of Presentation, Speaker Name / 23

Virtual Interface Edit Parameters

Rename Parameter

Rename Type

Provide Default Value

SAP AG 2003, Title of Presentation, Speaker Name / 24

Summary
Now you should be able to:
Use the Web Service Creation Wizard to create a Web service Manually create and edit a Virtual Interface

SAP AG 2003, Title of Presentation, Speaker Name / 25