topic2 part1 web service creation

25
SAP Flashbook Providing Web Services Part 1 Author: Susanne Rothaug This e-learning session contains narration!

Upload: 007veer

Post on 29-May-2017

233 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Topic2 Part1 Web Service Creation

SAP FlashbookProviding Web ServicesPart 1Author: Susanne Rothaug

This e-learning session contains narration!

Page 2: Topic2 Part1 Web Service Creation

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

Page 3: Topic2 Part1 Web Service Creation

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

Page 4: Topic2 Part1 Web Service Creation

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

Page 5: Topic2 Part1 Web Service Creation

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

The Web Service Creation Wizard - 1 -

EJB „CreditLimitBean“

Web Services Perspective

Page 6: Topic2 Part1 Web Service Creation

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

The Web Service Creation Wizard - 2 -

Page 7: Topic2 Part1 Web Service Creation

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

The Web Service Creation Wizard - 3 -

Page 8: Topic2 Part1 Web Service Creation

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

The Web Service Creation Wizard - 4 -

Virtual Interface

Web Service Definition

Specify EAR Project

Page 9: Topic2 Part1 Web Service Creation

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“

Page 10: Topic2 Part1 Web Service Creation

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

The Web Service Navigator

New Web service

Page 11: Topic2 Part1 Web Service Creation

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

Page 12: Topic2 Part1 Web Service Creation

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

Page 13: Topic2 Part1 Web Service Creation

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”

Page 14: Topic2 Part1 Web Service Creation

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

Page 15: Topic2 Part1 Web Service Creation

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, …

Page 16: Topic2 Part1 Web Service Creation

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

Page 17: Topic2 Part1 Web Service Creation

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

Page 18: Topic2 Part1 Web Service Creation

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

Page 19: Topic2 Part1 Web Service Creation

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

Create Virtual Interface - 1 -

Choose New Virtual Interface

Page 20: Topic2 Part1 Web Service Creation

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

Create Virtual Interface – 2 -

Select a package

Give a name to the VI

Page 21: Topic2 Part1 Web Service Creation

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

Create Virtual Interface – 3 -

Select or deselect methods

Page 22: Topic2 Part1 Web Service Creation

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

Create Virtual Interface – 4 -

New VIMethod creditLimitCheck

Page 23: Topic2 Part1 Web Service Creation

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

Virtual Interface – Edit Method

Remove method

Change method name

Page 24: Topic2 Part1 Web Service Creation

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

Virtual Interface – Edit Parameters

Rename Type

Rename Parameter

Provide Default Value

Page 25: Topic2 Part1 Web Service Creation

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