abap web services

Upload: devineni-naga-kiran

Post on 11-Feb-2018

229 views

Category:

Documents


1 download

TRANSCRIPT

  • 7/23/2019 ABAP Web Services

    1/56

    Web service

    A Web service is an independent, modular, self-describing application function or service. Based on XML

    and other standards, this application function can be described, made available, located or called using

    internet protocols. Each Web service therefore encapsulates a piece of functionality that can be used, for

    eample, to for!ard a price "uery to a provider, chec# the availability of an item in an enterprise resource

    planning system, or locate a telephone number.

    Providing a Web Service

    The provider of a Web service is generally called a service provider. The service provider will

    have a corresponding XML-based description of the Web service in the Web Service

    Description Language (a WSDL docuent!. "n principle# any prograing language can be

    used to ipleent this service. $ased on the %TT& transport protocol# Siple 'bect )ccess

    &rotocol (S')&! is now established as the *uasi-standard access protocol.

    Publishing a Web Service

    When publishing a Web service# the service provider transits inforation about itself and a

    description of the service it is o+ering and transfers this to the services registry. ) services

    registry can be described as a type of ,ellow &ages for Web services. "n addition to other

    data# it also provides inforation on calling the Web service# for eaple. The services

    registry therefore provides a description of the Web service only. This description fors an

    abstraction layer and is therefore not dependent on the corresponding ipleentation.

    The standard register used is the DD" services registry (niversal Description# Discovery

    and "ntegration!. S)& provides a public DD" server at http/00uddi.sap.co# and any )$)&

    client can be set up as a services registry.

    Consuming a Web service

    $he user of a Web service is called a service consumer. %n most cases, the service consumer is an

    application that accesses the Web service. $he application obtains the necessary information for this from

    the service description, !hich is, for eample, stored in the services registry.

    ABAP Web Services

    S)& 1etWeaver )pplication Server for )$)& provides a standardi2ed architecture and a set

    of tools for creating Web services and related obects. 3isting $)&"s or reote-enabled

    function odules can be used for setting up Web services or you can develop new Webservices in the 'bect 1avigator of S)& 1etWeaver )S for )$)&. There are prede4ned

    settings for securing Web services or the transports being used. )$)& Web services can be

    used for counication between S)& systes and between S)& and non-S)& systes.

  • 7/23/2019 ABAP Web Services

    2/56

    Developing Web Services

    ,ou can use the )$)& Wor5bench to create )$)& Web services in the following ways/

    Web service providers

    ,ou can create a Web service provider fro eisting 678 odules or fro WSDL

    docuents. 'r you can odel the in the 3nterprise Services 6epository or directly inthe )$)& bac5end.

    7or ore inforation# seeWeb Service &roviders

    Web service consuers

    ,ou can create a service consuer for your Web service provider.

    7or ore inforation# seeWeb Service 8onsuers

    "ntegration Scenario De4nitions

    )n integration scenario de4nition is a developent obects that groups interactions on a

    logical level. 7irst# seantic contracts are created that describe interactions between

    counication partners. 7or every such interaction# you can build one or ore

    de4nitions that are binding for both partners and for the basis for their

    ipleentations. There are no separate provider and consuer odels that can evolve

    independently.

    7or ore inforation# see"ntegration Scenario De4nitions

    )$)& &roies

    ABA& proies correspond to different entities of Web services, such as port types, messages, and

    schema types. $echnically, ABA& proies consist of t!o parts'

    classic ABA& ob(ects' such as interfaces, classes, and ))%* types,

    metadata +&X ob(ects

    $hese t!o parts are al!ays edited and transported together.

    ABA& proies can be displayed using different bro!sers

    Enterprise ervice Bro!ser ' /andles all ABA& proies.

    Enterprise ervices epository Bro!ser ' /andles ob(ects that !ere modeled in E.

    Enterprise Service Browser$he Enterprise ervice Bro!ser provides a vie! on all Web service ob(ects that are available in the ABA&bac#-end. 0sing the Enterprise ervice Bro!ser, you can "uic#ly locate ob(ects as they are organi1ed

    according to different entry points in tree structures.

    EB lets you bro!se proies for all ob(ect types that are used for ABA& Web services. )isplay the

    Enterprise ervice Bro!ser using transaction code SPROXY.

    http://help.sap.com/saphelp_nw74/helpdata/en/47/a9903ea2634847e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/a9903ea2634847e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bcd5b65a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bcd5b65a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/17/3a78ec1341467f889f5a29c6ac06f4/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/17/3a78ec1341467f889f5a29c6ac06f4/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bcd5b65a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/17/3a78ec1341467f889f5a29c6ac06f4/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/a9903ea2634847e10000000a421138/content.htm
  • 7/23/2019 ABAP Web Services

    3/56

    2ou can also start the ABA& Wor#bench using transaction code SE80and choose Enterprise ervice

    Bro!ser. %f this option is not available, choose tilities Wor5bench (9eneral! andselect Enterprise ervice Bro!ser.

    Enterprise Services Repository Browser

    Enterprise ervices epository Bro!ser +E epository Bro!ser is located in the ABA& bac#-end

    system, and provides a vie! on the data in the Enterprise ervices epository. $he E epository

    Bro!ser lets you create, change, chec#, activate, and delete proies for all ob(ect types that have been

    modeled in the Enterprise ervices epository. 3or eample, service interfaces.

    Starting the Enterprise Services Repository Browser

    :. 8all the 'bect 1avigator (transaction code S3;

    =. 8hoose 3nterprise Services $rowser.

    The software coponent versions are displayed.

    1ote"f the 3nterprise Services 6epository $rowser button is not displayed# choose tilities

    Settings Wor5bench (9eneral! and select 3nterprise Services 6epository $rowser.

    Features o ESRB! $he E epository Bro!ser displays the structure o f the ob(ects in the Enterprise

    ervices epository

  • 7/23/2019 ABAP Web Services

    4/56

    $he top-level nodes of the tree represent the soft!are component versions. When you epand a

    soft!are component version, the namespaces available for that soft!are component version are

    displayed.

    2ou can epand a namespace to display the ob(ects available for that namespace.

    4b(ects of each type are displayed in a separate node. 3or eample, message types, or data

    types. Epand a node to display all the ob(ects of that type.

    When an obect is displayed# you can perfor the following proy-speci4c operations/

    8hec5 8hec5s the consistency of a proy

    6egenerate 6egenerates a proy

    This function will only be available if the proy has already been generated.

    )ctivate )ctivates a generated proy

    se the &roy enu to perfor the above operations.

    The 3S6 $rowser o+ers the following navigation functions/

    "ntegration $uilder 'pen the S)& 1etWeaver 3change "nfrastructure

    8onnection Test Tests the connection to the 3nterprise Services 6epository

    Display WSDL Docuent Displays the WSDL representation of the currently selected proy

    se the 9oto enu to perfor the above functions.

    The 3S 6epository $rowser o+ers the following display functions/

    6efresh 6efreshes the browser> the obects displayed in the tree are reloaded

    3change "nfrastructure 'pen the S)& 1etWeaver 3change "nfrastructure

    7ilter )llows you to specify 4lter criteria to restrict the obects displayed in the tree

    1ote that the 4lter settings will be stored for each user.

    Search Search the tree to locate speci4c obects

    se the 3S 6epository $rowser toolbar (above the obect tree! to perfor the above

    functions.

    Constraints

    The 3S 6epository $rowser allows you to change soe obect attributes. 8hoose Display ?-@

    8hange.

    To create obects# wor5 with the "ntegration $uilder.

    "b#ect States

    $he functions available depends on the state of an ob(ect. 3or eample, if an ob(ect does not have a

    proy, only t!o functions !ill be possible' *reate &roy and )isplay W)L.

  • 7/23/2019 ABAP Web Services

    5/56

    4b(ects can have the follo!ing states'

    The proy obect is up-to-date. S)& obects in custoer systes are always up-to-date.

    The proy obect is orphaned/ no corresponding obect is available in the 3nterprise Service 6epository.

    1ote that this icon is not displayed in the 3nterprise Services $rowser as orphaned obects are collected

    in a separate node.

    1o proy eists for this obect

    Conte$t %enu

    2ou can perform operations on proies by using the contet menu. $o display the contet menu, right-clic#

    over an ob(ect in the E epository Bro!ser.

    Double&Clic'

    2ou can double-clic# an ob(ect to perform an operation on it. $he operation triggered depends on the

    ob(ect5s state' %f a proy has already been generated for an ob(ect, double-clic#ing the ob(ect displays the

    proy. %f no proy eists for an ob(ect, !hen you double-clic#, you are prompted to create a proy.

    ABAP Pro$y Editor,ou can display and edit )$)& proy obects in the proy editor. ,ou can browse Web service

    obects using the3nterprise Services $rowser (transaction code SPROXY! and double-clic5 on

    an obect to open it in the proy editor.

    $elow is a suary of the inforation displayed for an )$)& proy. Depending on the proy

    obect# soe of the tabs ay not be available.

    (ab )normation Displayed

    &roperties )n overview of attributes that identify the proy obect. These attributes include/ type# nae#

    naespace# the )$)& nae# and the user who created the proy.

    1ae

    conAicts

    %ere# you can correct naes that were truncated during generation# or naes that are causing a

    conAict.

    This tab is only displayed if nae conAicts occurred when the proy was generated.

    sed

    obects

    )n overview of the obects generated for a proy. These obects include data eleents# classes#

    structures# and interfaces.

    Double-clic5 a row to display the coponents of an obect.

    "nternal

    view

    Shows the hierarchy of the obects generated. Siilar to thesed 'bects tab. %ere# the obects

    are displayed hierarchically in the contet they are used. 8lic5 on an obect in the tree on the left

    hand-side to display details on the right hand-side.

    3ternal

    view

    Shows the obect as it is seen by the outside world. The eternal naes of the obects are

    displayed as seen eternally as well as in the 3S 6epository.

  • 7/23/2019 ABAP Web Services

    6/56

    Warnings 3ven if a proy was generated successfully# there are situations when an obect type created in

    the "ntegration $uilder does not correspond eactly to a particular obect type in the S)& syste.

    )$)& data types and schea types can di+er in parts. Therefore# soeties )$)& data types

    ust be used that do not atch the schea data type# which can lead to diBculties at runtie.

    "f such situations occur during proy generation# they are recorded with their appropriate level of

    severity and displayed in the Warnings tab.

    8on4gurati

    on

    Displays the properties for the proyCs runtie environent.

    WSDL Displays the WSDL0schea for the service provider# service consuer# and the data types.

    ABAP Pro$y *eneration & *eneral ProcedureUse

    This section outlines the general procedure for generating# regenerating# and deleting )$)&

    proies with generation source 3S6 or eternal WSDL. )dditional inforation for generating

    speci4c proy types is provided in separate sections.

    The procedure to generate )$)& proies is essentially the sae for each di+erent type of

    proy. There are two ain steps/

    Select the obects to be called or ipleented.

    9enerate and activate the proies.

    Prerequisites

    $o !or# !ith ABA& proies, you need the SAP_XI_DEVELOPER_ABAProle, !hich is included in the

    composite role SAP_XI_DEVELOPER. 0se the profile generator +transaction PFCG to assign roles.

    )epending on the proy type, the follo!ing tas#s must be done before you generate a proy'

    )ll obects ust be modeledin the 3S 6epository - or be ade available as eternal

    WSDL descriptions.

    Soe obects in the 3S6 are cobinations of other obects. 7or eaple# a service

    interface contains data types and essage types. Therefore# a proy (a Web service

    provider or a Web service consuer! can only be generated when all referenced types

    are generated as well. When a proy that is odeled in the 3S 6epository is generated for

    an obect that references another obect in the sae naespace# the proy for the

    referenced obect will be generated autoatically. 7or eaple# a proy could be

    generated for a service interface that references a speci4c data type. "f a referenced

    obect is in a di+erent naespace# you need to generate the proy for the referenced

    obect separately.

  • 7/23/2019 ABAP Web Services

    7/56

    When a proy is generated fro an eternal WSDL docuent# all of its obects are

    generated.

    The pac'age structurein the )$)& bac5-end syste ust be de4ned.

    The pac5age structure de4nes where the proies will be created# where the serviceprovider will be# and how the pac5ages will 4t into the overall application structure. 1ote

    that for proies fro eternal WSDLs# the pac5age is part of the eternal nae and

    obects that reference other obects use the eternal naes for these references. "f the

    pac5age of soe of these obects is changed after proy generation# these references get

    lost. Therefore# the pac5age should not be changed after proy generation.

    Pre+$esfor the )$)& obects can be de4ned.

    When generating proies# any di+erent obects are created. )ll eternal obects have a

    rather long *uali4ed nae consisting of nae and naespace. The )$)& obects only

    have a

  • 7/23/2019 ABAP Web Services

    8/56

    The pre4 you speci4ed is displayed as part of the )$)& nae in the &roperties tab and

    also in theStructure tab.

    G. )ctivate the proy.

    The )$)& obects# such as DD"8 types# classes# and interfaces# are created or changedonly when the proies are activated. When generating# regenerating# and editing# or

    saving the proies# the )$)& obects are not touched. When saving a proy# an inactive

    version of the etadata is created. To change the )$)& obects that are used at runtie#

    an active version is necessary.

    H. 6elease the transport re*uest.

    1ote that the proy (S&6X obect! and the generates (8L)S# "1T7# T)$# DT3L! are

    transported together.

    I. 8reate a runtie con4guration for the proies.

    "n the syste that consues the Web service# create a logical port for the Web service

    consuer. "n the provider syste# create an endpoint for the service de4nition. 7or ore

    inforation# see 8on4guring Web Services in S') Manager.

    *enerating Pro$ies with )ndustry&Speci+c Enhancements

    $o activate industry classifications, you need to select an industry !hen you generate proies for Web

    services delivered !ith an Enhancement &ac#age. &erform the follo!ing steps'

    :. Log on to the bac5-end syste in 3nglish.

    =. Start transaction SM30.

    . 8hoose the SFWJ"1DST6, view.

    E. Select your industries.

    6. Regenerating a Pro$y

    7. %f an ob(ect is changed in the 3nterprise Services 6epository+E epository after it has been

    generated, the changes !ill not automatically be reflected in the proy in the ABA& bac#-end

    system. %f an ob(ect in the E epository is changed, you !ill need to regenerate the

    corresponding proy manually.

    8. 1ote;. "n the 3S 6epository $rowser as well as in the 3nterprise Service $rowser# an icon

    with a red triangle indicates a version of an 3S 6epository entity that is di+erent fro

    its proy version in the )$)& bac5-end syste.

    http://help.sap.com/saphelp_nw74/helpdata/en/b0/787748cf3a4200bb1ba32a62aa8519/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/b0/787748cf3a4200bb1ba32a62aa8519/content.htm
  • 7/23/2019 ABAP Web Services

    9/56

    :. "n the 3nterprise Services 6epository $rowser# locate the obect whose proy you

    want to regenerate.

    =. 'pen the contet enu and choose 6egenerate proy

    This function will only be available if a proy has already been generated.

    'nly the proy interfaces# datatypes# and classes will be overwritten. )$)& naes and

    types will reain intact if possible. "f# for eaple# a datatype has been changed in a waythat its )$)& type is no longer valid# it is adapted.

    . 6eactivate the proy.

    7ro the contet enu# choose )ctivate &roy.

    ,ou can choose between the options )ctivate# )ctivate Main# and )ctivate )ll# depending

    on wheter you want the underlying obects to be activated as well.

    Deleting a Pro$y

    :. "n the 3S 6epository $rowser# select an obect.

    =. 7ro the enu# choose &roy Delete .

    1ote

    The ipleenting class will not be deleted# but you will have to delete it anually. 'nlythe generated data will be deleted.

    Result

    When proy obects are activated# one or ore of the following )$)& obects are created/

    )$)& Dictionary types

    )$)& Dictionary types represent the global data types in the 3S 6epository. The syste

    also generates the data types that will be used as ethod paraeters.

    )$)& interface

    )n )$)& interface coprises interface types and constants.

    ) teplate of an )$)& class (proy class or ipleenting class! for provider orconsuer proies# if not already eistent

    ,ou have to anually adapt and activate ths teplate. "f you want to create a new one#

    you have to delete the ipleenting class or change its nae.

    The )$)& class of a service provider contains the ipleentation of the service provider

    ethods# and uses an )$)& interface. ) service provider class has one ethod for each

    operation odeled in the 3S 6epository. 7or a proy to be used by an application# the

    ethods will need to be 4lled with application coding.

    Example:1

    Concept'

    9. Every Web service is generated !ith a Web ervice )efinition Language +W)L.

    :. We !ill use the W)L to create a *lient &roy.

  • 7/23/2019 ABAP Web Services

    10/56

    Example' uppose !e have t!o systems ystem-9 ; ystem-:. We have created a !eb service inystem-9 ; !e !ant to consume that Web service in ystem-:. 3or this !e have to create a *lient &royin ystem-: !ith the help of W)L that is generated !ith the !eb service !hich is made in ystem-9.

    Settings' $o call the !eb service of system9 in system: the follo!ing settings must be done.

    9.

  • 7/23/2019 ABAP Web Services

    11/56

    *lic# on the create button.

    >. $he follo!ing screen appears.

    elect the radio button 0L/$$& )estination and clic# on the continue button.

    ?. $he follo!ing screen appears.

  • 7/23/2019 ABAP Web Services

    12/56

    %n the 0L provide the Web service definition language +W)L of the !eb service.

    *lic# on the continue button.

    ?.

    $he follo!ing screen appears.

  • 7/23/2019 ABAP Web Services

    13/56

    &rovide the prefi and stored it in a pac#age or in a local re"uest.

    $he follo!ing screen appears.

  • 7/23/2019 ABAP Web Services

    14/56

    *lic# on the complete button.

    7. After clic#ing on the complete button the follo!ing pop-up appears as#ing for filling the user id andpass!ord.

    $his user id and pass!ord is of that system in !hich !eb service eists. +&ermission to use the !ebservice of another system.

    &rovide the user name and the pass!ord and *lic# on the 4C button.

    8. $he follo!ing screen appears and the proy is created.

  • 7/23/2019 ABAP Web Services

    15/56

    ave and activate the proy. $his &roy is nothing but a class !hich eists in E:?.

    $he name of the proy is al!ays li#e this' *onsumer &roy &refi D *4 D ame of the Web ervice.

    When !e open the class in E:? it loo#s li#e this.

    Where FWG3M is our 3* 3M for !hich !e have created a client proy.

    @.

  • 7/23/2019 ABAP Web Services

    16/56

    J. Apply election and go to configuration tab to create the Logical &ort.

    &rovide the logical port name and its description.

    0L for W)L Access' W)L of the !eb service

    &rovide the user name and the &ass!ord of the system in !hich !eb service eists and clic# on applysettings.

    9. $he 3ollo!ing creen Appears.

  • 7/23/2019 ABAP Web Services

    17/56

    *lic# on save button. $he binding for the !eb service activated.

    99. o! *reate an Eecutable program and !rite the follo!ing code to call the 3* 3M.

    a *reate an ob(ect of the proy class and provide the name of the Logical &ort.

    b $hen call the 3* function module !ith the help of that ob(ect.

    )A$A' loGob(ect $2&E E3 $4 F&4X2G*4GFWG0M*EA$E 4BKE*$ loGob(ectEX&4$%< logicalGportGname 5F&4$GL)5.

    $2.*ALL ME$/4) loGob(ect-=1!sGfm

    EX&4$%

  • 7/23/2019 ABAP Web Services

    18/56

    input lsGinput

    %M&4$%8, display the function module.

    4pen the function Module 'ME_GET_CURRENT_USER_ID

    *hoose Utilities -= More Utilities -= Creating a Web Service -= From Function Module

    %n the Web ervice *reation Wi1ard, choose Continue

    Enter the name of the Web ervice )efinition

  • 7/23/2019 ABAP Web Services

    19/56

    %n the follo!ing screen, enter the re"uired data and select the chec#bo Name Ma!!ing. %f the chec#bo Name

    Ma!!ingis tic#ed, the !i1ard accepts the eisting names for the end point.

    *hoose Continue.

  • 7/23/2019 ABAP Web Services

    20/56

    %n the follo!ing screen, enter the re"uired data and select the chec#bo Release Service "or runtime.

    *hoose *ontinue.

    *hoose *omplete.

  • 7/23/2019 ABAP Web Services

    21/56

    ave as local ob(ect.

    $esting a Web ervice.

    #rere$uisites

    4pen the transaction WA)M%.

    elect the Web service definition you have created under S% &!!lication "or RFC'Com!liant FMs

    elect and epand the FWEBG

  • 7/23/2019 ABAP Web Services

    22/56

    *hec# the K:EE erver and chec# in your server.

    C(oose Web Service )ome!age *E+ecute ,utton -

    elect the )ocument tyleN under tyle definition in W)L.

  • 7/23/2019 ABAP Web Services

    23/56

    $he Web service re"uires authentication.

    Enter the user and pass!ord

    *lic# on the $estN.

    elect the 4perationsN.

  • 7/23/2019 ABAP Web Services

    24/56

    3ill in values for the method parameters underneath the heading Re$uest i" re$uired. *hoose Send

    $he re"uired values are displayed under the Res!onseheading. $he Web service has not been tested

    successfully.

    Example 3 :

    Description' *reating ABA& based Web services and consuming in report. %n this eample !e !ill be using

    !i1ard provided by A&.

    8. Enter the name of the function module already created.

  • 7/23/2019 ABAP Web Services

    25/56

    Menu-=utilities-=more utilities-=create !eb service-=from function module'

    Enter the ervice )efinition ame follo!ed by short tet as sho!n belo!

    elect the end point, as of no! the follo!ing options are available

    3unction module

  • 7/23/2019 ABAP Web Services

    26/56

    3unction

  • 7/23/2019 ABAP Web Services

    27/56

    *lic# on *ompleteN and save it in pac#age.

  • 7/23/2019 ABAP Web Services

    28/56

  • 7/23/2019 ABAP Web Services

    29/56

    *lic# on generate function after selecting the respective !sd

    ave the !sdl file on to the local pc for further use

    Testing the web service

  • 7/23/2019 ABAP Web Services

    30/56

    *lic# on submitN button

    *opy the !sdl as sho!n

    W)L'

    http'yhsapJ.yashsap.com'@>sapbcsrtrfcsapFGEAG

  • 7/23/2019 ABAP Web Services

    31/56

    *lic# on testN button to test the functionality of !eb

    service

    *lic# on the parameters

    Enter the input parameters and clic# on submit

    Comments' $he !eb service has been tested successfully and is ready to use.

    *reate any client application for consuming it.

    Generating the proxy objectCons!ming in "#"P

    Login to A& system.

  • 7/23/2019 ABAP Web Services

    32/56

  • 7/23/2019 ABAP Web Services

    33/56

    %f needed configure the proy settings

    3or configuring proy settings clic# on

  • 7/23/2019 ABAP Web Services

    34/56

    Creating *ogical port

  • 7/23/2019 ABAP Web Services

    35/56

    *& A!"#OR$ %'()r' )''r+*&---------------------------------------------------------------------*REPOR" XI3.*&----------------------------------------------------------------*&*& D't' De%,'r't+o(*&----------------------------------------------------------------*&t',e $ p,+.DA"A$ pro/ "YPE REF "O 1%o_12et,+2t)et4_5)6 O!"P!" tpe GE"SFLIG#"DE"RESPO7SE 6 I7P!" tpe GE"SFLIG#"DE" .D't' $ _',t tpe re to %/_'+_te9_',t6 'pp_',t tpe re to %/_'+_'pp,+%'t+o(_',t.D't' $ +t' tpe p,+.*&----------------------------------------------------------------*&*& !I De%,'r't+o(*&----------------------------------------------------------------*&p'r'9eter $ p_%'rr+) tpe p,+-%'rr+)6 p_%o((+) tpe p,+-%o((+).*&----------------------------------------------------------------*&*& App,+%'t+o( ,o2+%

    *&----------------------------------------------------------------*&t'rt-o-e,e%t+o(."RY. CREA"E OB:EC" pro/ e/port+(2 LOGICAL_POR"_7AME ;

  • 7/23/2019 ABAP Web Services

    36/56

    ? otpt-pr+%e6 ? otpt-e't9'/6 ? otpt-e'to%%.

    Performing test from client application)

    Eecute the application.

    %nput screen'

    ,!tp!t:

  • 7/23/2019 ABAP Web Services

    37/56

    *enerating an ESR&Based Provider Pro$y

    Prerequisites

    To generate a provider proy# the following obects ust already have been designed in the

    3nterprise Services 6epository/

    Data types

    Message types

    Service interface and its operations

    Context

    ,ou wor5 with the 3nterprise Service $rowser in the )$)& bac5-end syste and follow the

    general procedure for generating proies.

    More inforation/ )$)& &roy 9eneration - 9eneral &rocedure

    Procedure

    :. 9enerate a provider proy for an inbound service interface.

    =. )ctivate the provider proy.

    When the provider proy is activated# all the underlying data types and essage types

    will also be activated.

    . "pleent the provider proy.

    To ipleent a provider proy# you need to add application coding.

    )n active provider proy now eists in the )$)& bac5-end syste# in which the service

    will be provided.

    E. To be able to call a Web service# you have to create a runtie con4guration. To do

    this# use the S)& 1etWeaver )dinistrator. Start this tool fro the S') Manager

    (transaction code SOAMA7AGER!.

    Results

    )n endpoint eists that can be used to call the Web service.

    The provider proy coprises the following/

    )n )$)& proy interface

    )n ipleenting class that ipleents the proy interface

    http://help.sap.com/saphelp_nw74/helpdata/en/e5/004f22192b444ab0bac1364d73ea6f/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/e5/004f22192b444ab0bac1364d73ea6f/content.htm
  • 7/23/2019 ABAP Web Services

    38/56

    The ipleenting class contains the operations that were odeled in the 3nterprise

    Services 6epository as ethods.

    ) teplate for the ipleenting class is created during proy generation. ) developer ust

    add the appropriate application code to the ipleenting class. The )$)& proy interface is

    generated and cannot be changed.

    Example

    $elow is an eaple of an ipleentation of a ethod that returns an echo of iported

    data/

    ME"#OD MY_II_SY7C#RO7_I7BO!7D_I7"ERFEXEC!"E_SY7C#RO7O!S.

    **** I7SER" IMPLEME7"A"IO7 #ERE ****

    O!"P!"-RESPO7SE_MESSAGE_"YPE-SIMPLE ; I7P!"-RE!ES"_MESSAGE_"YPE-SIMPLE.

    E7DME"#OD.

    *enerating a Consumer Pro$y

    Use

    ,ou can generate consuer proies fro obects odeled in the 3nterprise Services

    6epository or fro a WSDL docuent. The resulting obects are in di+erent generatingapplications. 7or ore inforation on generating application# see the syste docuentation

    that you can access using the (ips and (ric'sicon in transactionSPROXY.

    )$)& consuer proies are used in an application to call (consue! a Web service.

    8onsuer proies need only to be generated and can then be used by an application. "f the

    obects for a consuer proy are odeled in the 3S 6epository# the corresponding 3S

    6epository obect is an outbound service interface.

    Prerequisites

    ) consuer proy can be generated if any of the following prere*uisites are et/

    The outbound service interace# which will be used to generate the consuer

    proy# is available in the 3S 6epository. ) WSDL docuent that describes the Web service to be called is available. 1ote that

    there are soe liitations to the WSDl content that is supported by )$)& proy

    generation. See the KEE

  • 7/23/2019 ABAP Web Services

    39/56

    =. 'pen the pac5age for which you want to generate the consuer proy.

    . 7ro the contet enu for the pac5age# choose 8reate 3nterprise Service .

    The Web Service creation wi2ard is started.

    E. When you are propted# select Service 8onsuer as the obect type.

    G. 8ontinue.

    H. Select the source of the WSDL docuent.,ou can select the following sources/

    3nterprise Services 6epository

    6L0%TT& Destination

    Local 7ile

    DD" 6egistry

    Services 6egistry

    I. 8ontinue.

    ;. Search for or specify th WSDL docuent.

    K. Specify a pac5age# a pre4# and a transport re*uest.

    :

  • 7/23/2019 ABAP Web Services

    40/56

    ) service variant is based on a service interface and reuses the ipleentation of that

    service to create the new service. "t is not necessary to create a new service

    ipleentation.

    ) service variant has its own WSDL and service endpoint# and is published to the Service

    6egistry in the sae way as any other standard service.

    Service interfaces can often contain any paraeters to support several di+erent use casesand to enable a high degree of reuse of services. 7or this reason# it can soeties be

    diBcult to 5now which paraeters in the service interface are relevant for their speci4c

    business purpose. $y using service variants# you can siplify the way a service is consued#

    for eaple# by hiding 4elds or assigning 4ed values.

    Procedure

    Creating a Service .ariant

    Service variants are created in the )$)& bac5-end syste.

    :. Start transaction SVAR.

    =. 8hoose 1ew.

    The Wi2ard for service variants is started.

    1ote)lternatively# you can start the Wi2ard fro the contet enu in the root node of the

    pac5age. 8hoose 8reate Service &rovider Service Fariant

    . Specify a nae and a naespace suB for the new service variant.

    The naespace is built by concatenating the naespace pre4 and the naespace

    suB. The naespace pre4 cannot be changed.

    E. "n the $ase Service "nterface bo# specify the service interface on which to base the

    new service variant# and its naespace.

    1oteThe service interface you specify ust be released. "f the service interface is not

    released# the syste prevents you fro continuing.

    G. 8hoose 8ontinue.

    H. Specify a pac5age and a transport re*uest.

    I. 8hoose 7inish.

    The new service variant is now created.

    When a service variant is 4rst created# it has the following default 4eld states/

    %idden with 4ed value propagation for all optional 4elds

    %idden without 4ed value propagation for all optional 4elds that reference cople types

    Fisible for all non-optional 4elds and for all operations

    1ote"f the base service is changed# for eaple# if optional 4elds or operations are added# the

    default state for the new 4elds and the new operations is %idden without 4ed value

    propagation so the service variant does not change its behavior.

  • 7/23/2019 ABAP Web Services

    41/56

    Editing a Service .ariant

    ,ou can change the following properties of a service variant/

    %ide or unhide operations fro the base service interface

    %ide 4elds fro the base service that are not re*uired for the service variant

    Set 4ed values for 4elds

    De4ne optional 4elds as andatory,ou cannot de4ne andatory 4elds as optional.

    To change a service variant/

    :. Start the proy editor (transaction code SPROXY!.

    =. Locate the service variant that you want to change.

    se transaction code S3;

  • 7/23/2019 ABAP Web Services

    42/56

    %idden %idden 4elds are not included in the payload.

    "f andatory 4elds are set to hidden# a value is re*uired.

    "f a XSD default value is assigned in the base service interface# this becoes the default 4eld

    value.

    "f a 4eld is hidden in a service variant# the 4eld is not included in the service described by the

    variant.There are two di+erent hidden states.

    %idden without 4ed value propagation

    This state is possible only for eleents that reference a cople type in the original XSD

    docuent. The eleent ust be optional or all subeleents ust also have the

    state %idden without 4ed value propagation.

    %idden with 4ed value propagation

    This state is possible only for leaf eleents or if all subeleents or attributes are hidden or

    optional.

    1oteThis option cannot be used for tables (9'/O%%r !.

    )ll 4ed values assigned to the 4eld or to subeleents or attributes are passd to theoriginal service ipleentation at runtie# unless one of the following conditions is et/

    o The sub4eld is part of a table

    o There is a 4eld which is %idden without 4ed value propagation in the

    chain between the %idden with 4ed value propagation super 4eld and the sub4eld

    with a 4ed value#

    Enterprise Services Wi-ard

    Use

    The 3nterprise Services Wi2ard guides you when you create any of the design tie obects

    used in the )$)& Web Services fraewor5.There are several entry points for the wi2ard# soe of which are contet-sensitive. "f you

    start the wi2ard ultiple ties in the sae session# values for pac5age# pre4# and transport

    re*uest are pre-4lled fro the previous start.

    7ro )$)& Wor5bench

    "n )$)& Wor5bench (transaction code SE80! in 3nterprise Services 6epository

    $rowser right-clic5 a pac5age and choose 8reate and then 3nterprise Service.

    7ro 3nterprise Services $rowser

    "n 3nterprise Services $rowser# right-clic5 a node above the obect you want to create

    and choose 8reate. 1ote that the wi2ard call is contet-sensitive# and it will o+er you the

    appropriate options to choose fro. 7or eaple# if you open it fro the 3nterprise

    Services node# you can create any proy obect. "f you open it fro a subnode# only the

    proy obects of this subnode are o+ered in the wi2ard.

    7ro the proy obects entry point

    "n transaction SPROXY_S"AR"# choose the icon.

    sing transaction code SPROXY_=I

    Start the wi2ard with all its options by entering the transaction code SPROXY_=I.

    Creating a Pro$y "b#ect

  • 7/23/2019 ABAP Web Services

    43/56

    "n the wi2ard# you have to specify the following/

    9eneration source

    ,ou can specify the following generation sources for the respective proy obects/

    Pro$y "b#ect Bac'e

    nd

    Enterprise

    Services

    Repository

    E$ternal

    WSD/0Schema

    E$isting ABAP

    "b#ect 1)nside

    "ut2 or Service

    .ariant

    Data types# essage types#

    data type enhanceents# fault

    essages# event providers

    X X

    Service consuers X X X

    Service providers X X X X

    Seantic contracts# contracts X X

    678 consuers X X (local 4le of the )$)&

    8onnector of the function

    odule!

    1oteThe generation source controls the source and scope of proy obects. ,ou can 4nd

    detailed inforation about the scope of proy obects in the syste docuentation. "n

    transaction SPROXY# choose the icon to display the docuentation. 8hoose &roy

    "denti4cation.

    1ae and a naespace for the proy obect

    The eternal nae that you de4ne in this step is the one that is eposed to non-)$)&

    applications. )n )$)& pac5age# a transport re*uest (optional!# and a pre4 (recoended!.

    3ither choose a transportable pac5age or select Local 'bect to assign this obect to

    the "MPpac5age. "f you enter a transportable pac5age# select a re*uest fro your

    transport syste. &re4es can be used to distinguish proy obects fro others.

    When you 4nish the wi2ard# the new unsaved proy obect is opened in the proy editor.

    Setting a Deault Pre+$

    ,ou can con4gure the wi2ard to be pre-4lled with a speci4c pre4 by specifying the user

    paraeter PRX_PREFIXin your user pro4le.

    :. "n the enu bar of your )$)& syste# choose Syste ser &ro4le 'wn Data .

    =. 'n the &araeters tab# enter PRX_PREFIXas the paraeter "D and specify the value

    to be used a default pre4 in the wi2ard.

    . Save.

    %odeling Web Service "b#ects in the Bac'&End

    ,ou can either odel Web service obects (data types# essage types# fault essage types#

    inbound service interfaces# outbound service interfaces# event providers# or data type

  • 7/23/2019 ABAP Web Services

    44/56

    enhanceents! in 3nterprise Services 6epository (3S6! or directly in the )$)& bac5-end.

    This procedure outlines the general principles of odeling Web service obects using the

    proy editor. The proy editor and 3nterprise Services Wi2ard are easy-to-use when following

    these principles.

    Prerequisites

    7or ore inforation on odeling services in 3nterprise Services 6epository# see the

    docuentation in the function-oriented view of the application help for S)& 1etWeaver on

    the S)& %elp &ortal athttp/00help.sap.co.

    ,ou have assigned your naespace to the )$)& bac5-end as the generating

    application in transactionSPX7GE7APPL. 7or ore inforation# see the chapter

    entitled Pro$y )denti+cationin the syste docuentation. To 4nd this docuentation#

    choose the Tips Tric5sN icon in transaction SPROXY.

    Procedure

    :. Start the proy editor# for eaple by double-clic5ing a Web service obect in

    3nterprise Service $rowser.

    'n the "nternal Fiew tab# the proy editor is divided in two parts. 'n the left hand side#

    the obect is displayed in a tree. %ere# you can use the contet enu to add obects or

    you can drag and drop obects fro 3nterprise Service $rowser or 3nterprise Service

    6epository $rowser. )lso# you always have a powerful 4eld help at your disposal that only

    o+ers obects that are allowed at this particular place.

    =. "n case of probles# the proy editor displays warnings on the botto of the window

    that often have long tets. 6ead through these long tets for helpful hints and solutionsto these probles.

    http://help.sap.com/http://help.sap.com/
  • 7/23/2019 ABAP Web Services

    45/56

    Web Service &roviders

    Use

    ,ou can provide Web services in the following ways/

    sing the 3nterprise Services 6epository (outside-in!

    This approach coprises basically two steps/

    o Developent of the service starts in the 3nterprise Services $uilder (3S

    $uilder!. "n contrast to inside-out developent (whereby a WSDL docuent is

    generated on the basis of an eisting function and then published!# the 3S $uilder

    creates the service iplicitly as a WSDL docuent in the 3nterprise Service 6epository

    (3S 6epository!.

    o To ipleent or call a service# developers generate proies in the relevant

    application syste for the service fro the 3S 6epository. Developents therefore

    begins outside the application syste and is then continued in the application syste(hence the ter outside-in!.

    7or calling a service# developent obects of a service that was described outside of the

    syste are generated into the respective developent syste (outside-in! with the help

    of a WSDL docuent.

    Modeling in the $ac5-end

    The )$)& bac5-end supports odeling functions that are siilar to those of the Oava-

    based 3nterprise Services 6epository. "t allows you to odel data types# essage types#

    and service interfaces directly in the )$)& developent environent.

    $ased on eisting functions (inside-out!

    The Web Service technology enables a copany to act as a so-called PproviderP and to

    provide services either within the copany or eternally. The proble posed by the use

    of di+erent prograing languages is overcoe by encapsulating an eisting function in

    a syste using a Web service. The Web service de4nition contains the signature for the

    function and other inforation re*uired to call it - such as the address of the server on

    which the function can be called. To provide this inforation to a consuer# you publish

    the Web service as a WSDL docuent. sing this XML standard# consuers of the

    services can generate a proy in their application systes# with which they can then use

    the S')& protocol to call the Web service.

    ) prograing-language-independent description of th interface used to call th function

    is provided to the outside for further use. "n this case# we refer to Pinside-out

    developentP.678-enabled function odules# function groups (that contain 678-enabled function

    odules!# and $)&"s can be ade available as Web services without any additional

    prograing. The service is in the syste already and can be published eternally

    (inside-out!.

    $ased on a WSDL docuent

  • 7/23/2019 ABAP Web Services

    46/56

    ,ou can either use a WSDL that is stored locally or retrieve it fro a 6L or a services

    registry. The WSDL docuent is a description of the Web service and contains all

    necessary inforation.

    1ote"nstead of Poutside-inP and Pinside-outP# the S') world coonly uses the following ters

    as well/ P8ontract-7irstP and P8ode-7irstP> PTop-DownP and P$otto-pP.

    )s a general guideline# you would use the inside-out approach if the obects are already

    there and you use the Web service for internal purposes only. 'therwise# you would usually

    odel the obects. When odeling the Web services# the WSDL docuents are cleaner and

    better to read for the outside world.

    Developing a Web Service ,sing the Enterprise Services

    Repository 1"utside&)n2

    Use

    ,ou create an outside-in service by perforing the following steps/

    Modeling in the 3nterprise Services 6epository

    8reating the interface

    "pleenting the application logic

    8on4guring the Web Service

    We distinguish between the following processing types for ethods of Web services/

    Synchronous

    )synchronous

    More inforation/Types of Message Transission.

    Prerequisites

    The Web service runtie has been con4gured (refer to 8on4guring the Web Service

    6untie!.

    The Web service has been odelled in the 3nterprise Services 6epository (3S6!.

    ,ou have activated the 3nterprise Services $rowserin the )$)& Wor5bench. ,ou can also call

    the browser in transaction S&6'X,.

    http://help.sap.com/saphelp_nw74/helpdata/en/47/9bc9f265a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/ab7d3b49f84848e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/ab7d3b49f84848e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/45/ff87daa1873830e10000000a11466f/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bc9f265a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/ab7d3b49f84848e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/ab7d3b49f84848e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/45/ff87daa1873830e10000000a11466f/content.htm
  • 7/23/2019 ABAP Web Services

    47/56

    The user is assigned the relevant )uthori2ations.

    Procedure

    :. 9enerate a provider proy.

    While the service odeling ta5es place centrally in the 3S 6epository# the proy

    generation and subse*uent service ipleentation is done in a speci4c bac5-end. $efore

    the corresponding Web service proy is generated# the developer has to decide in which

    syste the proy is to be generated. )fterwards# he or she starts the proy generation

    locally in this syste. This transfers the entities fro the 3S 6epository into the local

    syste. The resulting proies are stored in the bac5-end. The proies can be used

    independent of of the 3S 6epository. The connection to the 3S 6epository is only re*uired

    for generation# re-generation# and for chec5ing the proies against the 3S 6epository.

    8all transaction S&6'X,# select the inbound service interface# and choose 8reate&roy fro the contet enu. 3nter the nae of a pac5age. (6efer to Wor5ing with )$)&

    &roies!.

    The service de4nition is autoatically generated during proy generation.

    )fter generation# the provider proy contains ethods for each service operation.

    =. 7ill the operations with the re*uired logic.

    "n the &roperties tab of the service interface# clic5 the nae of the provider class# and

    then specify the ethod nae in order to get to the editor. ,ou then ipleent theprovider proy.

    . 8reate a runtie con4guration for the provider proy. "n the proy editor#

    choose Start S') Manager. 7or ore inforation# refer to 8on4guring a Service

    &rovider(fro point G onwards!.

    E. Test your service in the Web Service 1avigator.

    Select the service de4nition in the 'bect 1avigator (Transaction S3;

    Web Service 1avigator. Ma5e sure that a connection to the Web Service 1avigator has

    been set up (refer toSetting p the WS 1avigator!. "f the service has not yet been

    con4gured# a standard con4guration is created before starting the Web Service 1avigator.

    "n this case# choose the appropriate pushbutton.

    More inforation/Testing a Service.

    Result

    http://help.sap.com/saphelp_nw74/helpdata/en/48/475823e9d771b9e10000000a421937/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/e6/6d0f3fb35c48fa9fdf5f4e70d9f37d/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/e6/6d0f3fb35c48fa9fdf5f4e70d9f37d/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/33/06820d9d174c2884576bd78ac5629d/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/33/06820d9d174c2884576bd78ac5629d/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/c8/f0a0c9f03541edafe783c4a0ddb1aa/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/c8/f0a0c9f03541edafe783c4a0ddb1aa/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/a0/704eba24184bf5b4a84c790e06aa3a/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/475823e9d771b9e10000000a421937/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/e6/6d0f3fb35c48fa9fdf5f4e70d9f37d/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/e6/6d0f3fb35c48fa9fdf5f4e70d9f37d/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/33/06820d9d174c2884576bd78ac5629d/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/33/06820d9d174c2884576bd78ac5629d/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/c8/f0a0c9f03541edafe783c4a0ddb1aa/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/a0/704eba24184bf5b4a84c790e06aa3a/content.htm
  • 7/23/2019 ABAP Web Services

    48/56

    )n endpoint eists that can be used to call the Web service.

    The provider proy coprises the following/

    )n )$)& proy interface

    )n ipleenting class that ipleents the proy interface

    The ipleenting class contains the operations that were odeled in the 3nterprise

    Services 6epository as ethods.

    ) teplate for the ipleenting class is created during proy generation. ) developer ust

    add the appropriate application code to the ipleenting class. The )$)& proy interface is

    generated and cannot be changed.

    3aple

    $elow is an eaple of an ipleentation of a ethod that returns an echo of iported

    data/

    ME"#OD MY_II_SY7C#RO7_I7BO!7D_I7"ERFEXEC!"E_SY7C#RO7O!S.

    **** I7SER" IMPLEME7"A"IO7 #ERE ****

    O!"P!"-RESPO7SE_MESSAGE_"YPE-SIMPLE ; I7P!"-RE!ES"_MESSAGE_"YPE-SIMPLE.

    E7DME"#OD.

    Developing a Web Service Provider in the ABAP Bac'&End

    Prerequisites

    The Web service runtie has been con4gured (refer to 8on4guring the Web Service

    6untie!.

    The S)& syste uses the software coponent version S)& 1etWeaver I.< 3%&=# Service

    &ac5age

  • 7/23/2019 ABAP Web Services

    49/56

    Context

    ,ou can create a service provider locally in the bac5-end syste using the internal )$)&

    odeling functions. 7or ore inforation# see the docuentation on odeling services in

    3nterprise Services 6epository in the function-oriented view of the application help for S)&

    1etWeaver on the S)& %elp &ortal at http/00help.sap.co.

    Procedure

    :. 3nsure that your naespace is assigned to the bac5-end.

    "n transaction S&X1931)&&L# you can chec5 whether your naespace has been assigned

    to the bac5-end repository. "f not# add it to this list and assign it to the generation

    source $ac5end Metadata 6epository.

    =. "n the &roy 3ditor (transaction code S&6'X,!# in the 3nterprise Services

    $rowser right-clic5 on 'bect Types and choose 8reate new obect.

    . Select Service &rovider.

    E. Select )$)& bac5-end as the generation source for the service provider.

    G. Specify a nae# a naespace and (optionally! a pre4.

    The eternal nae that you de4ne in this step is the one that is eposed to non-)$)&

    applications that consue or provide the Web service. &re4es can be used to distinguish

    proy obects fro others. "f your naespace has not been assigned to the bac5-end yet#

    you get an error essage. )ssign the naespace as described in step : above.

    H. Specify an )$)& pac5age and a transport re*uest.

    3ither choose a transportable pac5age or select Local 'bect to assign this obect to

    your "MPpac5age. "f you enter a pac5age# select a re*uest fro your transport syste.

    I. 7inish the wi2ard.

    The proy obect is created and opened in the proy editor. 'n the &roperties tab# an

    epty class is displayed that you can ipleent as soon as the provider is activated.

    ;. 'n the internal or eternal view tab# add operations to your service provider by right-

    clic5ing on the service provider node.

    K. 'n the internal or eternal view tab# right-clic5 an operation to add essage types.

    7or an asynchronous operation# set a re*uest essage type. 7or a synchronous operation#

    also add a response# and# optionally# one or ore fault essage types.

    ,ou can either add an eisting essage type or create a new one. 8hoose the appropriate

    action fro the contet enu of the operation. "f you create a new one# the 3nterprise

    http://help.sap.com/http://help.sap.com/
  • 7/23/2019 ABAP Web Services

    50/56

    Services Wi2ard is started and leads you through the creation process. ,ou can also drag

    and drop essage types fro the 6epository $rowser or fro the 3nterprise Services

    $rowser.

    :

  • 7/23/2019 ABAP Web Services

    51/56

    8reating a Service De4nition

    3diting a Service De4nition

    8hanging the Service De4nition 8on4guration

    Creating an )nside&"ut Service De+nition

    Use

    The Web Service Wi2ard enables you to create a service de4nition in a few steps. ,ou can

    create Web services for 678-enabled function odules# function groups# and $)&"s. ,ou

    assign features that pertain# for eaple# to security or transport guarantees using

    con4guration pro4les.

    )fter you have created the service de4nition using the wi2ard# you can edit it subse*uently

    in the proy editor by opening it fro the 3nterprise Services $rowser 3nterprise

    Services Service De4nitions (refer to/3diting a Service De4nition!.

    Prerequisites

    The user has been assigned the appropriate )uthori2ations.Procedure

    :. "n the 6epository $rowser# choose the nae of the pac5age in which you want to

    create a Web service.

    =. "n the contet enu# choose 8reate 3nterprise Service Service &rovider

    3isting )$)& 'bects ("nside 'ut!.

    7or function groups and function odules# you can call the wi2ard fro the 7unction

    $uilder (S3I!. 8hoose the re*uired function odule# display it# and then choose

    tilities More tilities 8reate Web Service 7ro the 7unction Module or 7ro the

    7unction 9roup.

    1ote that the function group ust contain at least one 678-enabled function odule.

    Action! %eaning!

    8reate Service 3nter a nae and short tet for the service de4nition. 8hoose an end-point type.

    8hoose 3nd &oint 8hoose the obect that you want to o+er as a Web service. 7or $)&"s# enter the

    application.

    "f the chec5bo 1ae Mapping is ar5ed# the wi2ard accepts the eisting naes for the

    end point. "nitial letters are in uppercase and underscores are reoved "f this is not

    re*uired# create the service de4nition using the naes in the end point.

    8hoose 'perations 7or $)&"s and function groups# choose the operations for which the Web service is to be

    created.With Delete Line you can eclude operations of a $)&" or a function group that should not

    be provided in the service de4nition. )t least one operation ust be retained.

    8on4gure Services The features that can be assigned here to the Web service relate to *uestions of security

    of data transfer and the type of counication. The selected security level is to be

    understood as the iniu re*uireent for all runtie con4gurations of the service

    de4nition.

    8hoose a prede4ned feature set fro the pro4les available.

    http://help.sap.com/saphelp_nw74/helpdata/en/47/ab744a49f84848e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/a9883fa2634847e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/475823e9d771b9e10000000a421937/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/ab744a49f84848e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/a9883fa2634847e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/475823e9d771b9e10000000a421937/content.htm
  • 7/23/2019 ABAP Web Services

    52/56

    &67JDTJ"7JS38J%"9%

    )uthentication using certi4cates and transport guarantees

    &67JDTJ"7JS38JL'W

    )uthentication using user "D and password# no transport guarantee

    &67JDTJ"7JS38JL'W

    )uthentication using user "D and password and transport guarantee &67JDTJ"7JS38J1'

    1o authentication and no transport guarantee

    7or ore inforation on the features in the pro4les# refer to the section3diting a Service

    De4nition.

    8hoose Deploy Service to release the service for runtie.

    3nter

    &ac5age0Transport

    6e*uest

    3nter the nae of the pac5age and the transport re*uest nuber. ,ou do not need a

    transport re*uest for local obects.

    7inish The service de4nition is created.

    Result

    ,ou have created a Web service.

    ,ou can display and edit the service de4nition in the 'bect 1avigator in the pac5age you

    selected under 3nterprise Services Service De4nitions . 7or ore inforation# refer to

    the section 3diting a Service De4nition.

    8on4gure the Web service (refer also to 8on4guring the Service &rovider!.

    3ach service that you create in inside-out ode can be called synchronously and

    asynchronously.

    7or ore inforation# refer to the sections 8onsuing a Web ServiceandTypes of Message

    Transission.

    Editing a Service De+nition

    Prerequisites

    2ou have created a service definition using the service !i1ard.

    Context

    2ou create a service using the default values of the assigned profile. 2ou can change these values for

    function modules, BA&%s, and function groups.

    http://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/33/06820d9d174c2884576bd78ac5629d/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bcd5b65a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bc9f265a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bc9f265a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/517b1b034e72d2e10000000a42189c/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/33/06820d9d174c2884576bd78ac5629d/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bcd5b65a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bc9f265a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bc9f265a9484be10000000a421138/content.htm
  • 7/23/2019 ABAP Web Services

    53/56

    Procedure

    :. Double-clic5 the service de4nition in the subtree Service De4nitions in the 6epository

    $rowser of the )$)& Wor5bench under 3nterprise Services.

    =. "n the application toolbar# choose Display08hange."e o,,o5+(2 t' 're

    )+p,'e).

    ,ption Description

    Properties %n this tab page you find general information on the service provider

    E$ternal

    .iew 0

    )nternal

    .iew 0 (ypes

    Ma5e changes in the 3ternal Fiew tab page if the service de4nition is to be displayed

    to the outside in a di+erent for.

    Change 3ames o "perations

    Select the operation whose nae you want to change. Specify the desired nae for

    the operation in the 'peration 4eld/

    Adapt Parameters

    8hoose the re*uired paraeter/ ,ou can then a5e any of the following changes to it/

    8hange &araeter 1ae

    "n the &araeter 4eld# enter the selected nae.

    8hange &araeter Type

    ,ou can change the type of a paraeter if it is based on a structured type or table

    type.

    To change the type of paraeter# proceed as follows/

    8hoose the Types tab.

    Select the type you want to copy. 8hoose 8opy (fro the contet enu or

    application toolbar!.

    "n the dialog bo that appears# enter a nae for the copied type. "t then appears in

    the 8opied Types category.

    7ields belonging to the type can be deleted by selecting the appropriate function in

    the contet enu. "f the copied type includes other 4elds that are based on a

    structured or table type# the contet enu also contains the 8hange Type option. "f

    you want to change a type# choose a suitable type in the dialog bo that appears.

  • 7/23/2019 ABAP Web Services

    54/56

    ,ption Description

    ,ou will perhaps have copied this previously (see above!. 8hoose the 3ternal

    Fiew tab in order to assign the new type. 8on4r with Return.

    De+ne Deault .alue

    &araeters that are optional in the original interface can also be optional in the

    service de4nition. "n this case# the default value of the original interface is used.

    )lternatively# you can enter a default value yourself.

    4ide Parameters

    nchec5 the 3posed chec5bo.

    "f a paraeter is hidden# it does not appear in the WSDL docuent at all. "n suchcases# the 4ed value or paraeter initial value is used.

    "b#ects ,sed

    "n this tab# all the obects belonging to the service provider are listed. The )$)&

    naes can be changed.

    Con+guration 7or ore inforation# refer to the section8hanging the 8on4guration.

    WSD/

    "n the case of a WSDL docuent that is the basis for the service de4nition# you can

    choose either the 6&8 or Docuent style.

    ,ou can save the WSDL to a 4le using the corresponding pushbutton or you can copy

    the 6L to be able to use it during proy generation.

    Classi+cation ,ou can publish the tModel of a service (this is the technical speci4cation of a service!

    in a Services 6egistry and classify and publish service de4nitions. tModels of services

    (based on a function odule# a function group# a $)&"# or a essage interface! arepublished fro the )$)& bac5end.

    tModels of services that were odeled in the 3nterprise Services 6epository are

    published directly fro the 3nterprise Services 6epository. 7or ore inforation# refer

    toWor5ing with a Services 6egistry.

    http://help.sap.com/saphelp_nw74/helpdata/en/47/a9883fa2634847e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/a9883fa2634847e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/ca/aeed3629c54f13ba642d82d8c28e51/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/ca/aeed3629c54f13ba642d82d8c28e51/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/a9883fa2634847e10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/ca/aeed3629c54f13ba642d82d8c28e51/content.htm
  • 7/23/2019 ABAP Web Services

    55/56

    ,ption Description

    &rere*uisite for the classi4cation and publication is that a connection to the re*uired

    registry is set up (refer to Setting p a 8onnection to the Services 6egistry!.

    Changing the Service De+nition Con+guration

    Procedure

    "n the 8on4guration tab# you will 4nd the features that were assigned at interface# security#

    and operation level using the service wi2ard pro4les. Ma5e the changes you re*uire. 1o

    changes can be ade to service interfaces.

    )nterace Pro+le

    "n the interface pro4le# choose the re*uired processing type/ Stateful or Stateless.

    ) stateful service retains its status within the fraewor5 of a %TT& session throughoutseveral calls fro the sae service consuer. The default value for services is stateless. "f

    you re*uire stateful counication# you can choose this instead.

    "f you choose the nae of the con4guration# the "87 ("nternet 8ounication 7raewor5!

    service node of the S')& runtie is displayed on the right-hand side in the &ath &re4 4eld.

    The essage identi4er has the standard value True. sing the

    "7JWS&6'T'8'LJM3SS)93J"D protocol# you can *uery the sent essage.

    7or ore inforation# refer to the section &rotocols.

    Security Pro+le

    "n the security pro4le# choose the type of authentication for calling the Web service through

    a service consuer. ,ou de4ne how transport security (a5ing sure the data transfer is

    secure! between the consuer and the provider is to ta5e place.

    "peration Pro+le

    The operation pro4le has the default value Synchronous. "f you choose the status stateful in

    the interface pro4le# you can choose also Synchronous 8oit and Synchronous

    6ollbac5 for all operations ecept Synchronous.

    The assignents of the following (non-changeable! properties of operations can be

    displayed.

    Property! %eaning!

    $loc5ing 8alling a proy (ore precisely# transitting a essage to the essage infrastructure! causes

    the caller to be bloc5ed until the business reply has been received and returned to the caller.

    8oit

    %andling

    8oit06ollbac5 8ontrol Through the 7raewor5

    The 7raewor5 is responsible for closing transactions (coit or rollbac5!. The application

    signali2es only whether a 8'MM"T or 6'LL$)8Q is to be eecuted.

    Transaction

    %andling

    Description of the Transactional $ehavior of the Message "nfrastructure Transactional processing

    eans that the essages that are passed to the essaging infrastructure are collected up until

    the end of the transaction (LW!. Depending on the type of transaction copletion

    (coit0rollbac5!# the essages are discarded or stored for subse*uent processing. The

    http://help.sap.com/saphelp_nw74/helpdata/en/25/683fbe7e01407cb20995d10d71c895/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/d40aca1904154ee10000000a421937/frameset.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/d40aca1904154ee10000000a421937/frameset.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/5a3c285ae007dbe10000000a42189b/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/25/683fbe7e01407cb20995d10d71c895/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/d40aca1904154ee10000000a421937/frameset.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/48/5a3c285ae007dbe10000000a42189b/content.htm
  • 7/23/2019 ABAP Web Services

    56/56

    Property! %eaning!

    transactional connection is not passed to the server side.

    6eliable

    Message

    3change

    With Web Services 6eliable Messaging# the following is possible/

    The sender of a essage can deterine whether a essage was received by the

    desired receiver and can then trigger appropriate easures if this is not the case. The receiver of the essage can be sure that he or she receives the essage# despite

    unforeseen probles with networ5s or the software.

    6T "ntrinsic

    7eatures

    Type of Message 3change

    'ne Way

    Data is transferred fro the sender to the receiver without a reply being epected fro the

    application.

    6e*uest 6esponse

    The essage echange consists of a *uery and a reply at application level.

    7or ore inforation# refer to the sectionTypes of Message Transission.

    http://help.sap.com/saphelp_nw74/helpdata/en/47/9bc9f265a9484be10000000a421138/content.htmhttp://help.sap.com/saphelp_nw74/helpdata/en/47/9bc9f265a9484be10000000a421138/content.htm