Topic2 Part1 Web Service Creation

Preview:

Citation preview

SAP FlashbookProviding Web ServicesPart 1Author: Susanne Rothaug

This e-learning session contains narration!

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

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 / 3

Creating a Web Servicein less than ONE minute

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

2• Wizard based approach• Based on preconfigured profiles• Based on abstract behaviour• Available for ABAP & Java

3• Deployment in Java• Activation in ABAP

Activate /Deploy Web Service

GenerateWeb Service

Implement Business Application

WS Configuration

WS Definition

Virtual Interface

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

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 wizardDefault values (profiles) for other settings

Hides technical details

Implicitly creates all necessary objects

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

The Web Service Creation Wizard - 1 -

EJB „CreditLimitBean“

Web Services Perspective

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

The Web Service Creation Wizard - 2 -

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

The Web Service Creation Wizard - 3 -

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

The Web Service Creation Wizard - 4 -

Virtual Interface

Web Service Definition

Specify EAR Project

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

The Web Service Creation Wizard - 5 -

Build EAR File

Choose „OK“

Choose „Deploy to

J2EE Engine“

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

The Web Service Navigator

New Web service

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

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 / 12

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 / 13

The Web Service Homepage: Test a Web Service

URL of WSDL

Choose “Test” Click on

method name

Enter idCategory

and idNumber

Response: “OK”

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

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 / 15

Creating a Web Service step by step for individual needs

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

2• Abstraction from Implemenatation

5• Deployment in Java• Activation in ABAP

Activate /Deploy Web Service

CreateVirtual Interface

Implement Business Application

WS Configuration

WS Definition

Virtual Interface

CreateWeb Service Definition

3• Defines abstract behaviour

ConfigureWeb Service

4• Individual Configuration of Security, Session, …

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

Web Service Entities

Business Application

Virtual Interface 1 Virtual Interface 2 Virtual Interface n

WS Definition 1 WS Definition 2 WS Definition m

1:n

1:m

WS Configuration 1 WS Configuration 2 WS Configuration p

1:p

Web Service 1 Web Service 2 Web Service p

1:1

ConcreteConfiguration

Web Service

AbstractBehaviour

InterfaceViews

Application Layer

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

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 / 18

Web Service Virtual Interface –Background -

VirtualInterface

ImplementationLayer

i_creditsegment (I)

i_partner (I)

e_score (O)FSCM_Cr_Limit_Check e_limit

(O)e_currency

(O)e_valid_to

(O)

<SOAP-ENV:Envelope> <SOAP-ENV:Body> <ns1:creditLimitCheck> <ns1:idNumber>1001</ns1:idNumber>     </ns1:creditLimitCheck>   </SOAP-ENV:Body> </SOAP-ENV:Envelope>

<SOAP-ENV:Envelope>   <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> </SOAP-ENV:Envelope>

idNumber (I)

score (O)

creditLimit (O)

limitCurrency (O)

valid To (O)

creditLimitCheck

Request

Default Value: BUP001

Response

Rename methods

Rename parameters

Provide default values/ hide parameters

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

Create Virtual Interface - 1 -

Choose New Virtual Interface

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

Create Virtual Interface – 2 -

Select a package

Give a name to the VI

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

Create Virtual Interface – 3 -

Select or deselect methods

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

Create Virtual Interface – 4 -

New VIMethod creditLimitCheck

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

Virtual Interface – Edit Method

Remove method

Change method name

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

Virtual Interface – Edit Parameters

Rename Type

Rename Parameter

Provide Default Value

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

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