expose a service
How to expose a service?
Let’s try to establish sync communication.
- User can fill information about his details.
- Get the Confirmation that data has been updated in
R3 table.. User created
Now idea is that.. 1. Create A RFC Enabled Funcation module form Se37..
Import parameter : Information provided by 3rd Party application Export parameter : Confirmation message.. User id had been created. 2. Create a Service Defication for that service ( Se37 /or SPROXY or SE80) 3. Expose that service in SOAMANGER 4. Expose the service in Service Registry 5. Test form WS Navigator tool and 3rd Party application
Create Custom table, where you want to update data : SE11
Ref : Fig 1
Create RFC enable Function Module : ( Transaction Se37 –SAP R3) Import Parameters :Ref : Fig 2 Export Parameters :Ref : Fig 3 Source Code FUNCTION ZRFC_USER_CREATE. *”———————————————————————- *”*”Local Interface: *” IMPORTING *” VALUE(NAME) TYPE STRING *” VALUE(FNAME) TYPE STRING *” VALUE(LNAME) TYPE STRING *” VALUE(REGIO) TYPE STRING *” VALUE(LAND1) TYPE STRING *” EXPORTING *” VALUE(MSG) TYPE STRING *”———————————————————————- Data : it_user type standard table of ZUSER_HATI, wa_user type ZUSER_HATI. Data : str1 type string. if NAME is initial. str1 = ‘Please fill user name field’.
select single * from ZUSER_HATI into wa_user where NAME = NAME. if sy-subrc eq 0. concatenate ‘The user ‘ NAME ‘ has already exists. Please choose other
one’ into str1.
clear : wa_user. wa_user-NAME = NAME. wa_user-fname = fname. wa_user-lname = lname. wa_user-regio = regio. wa_user-land1 = land1. insert ZUSER_HATI from wa_user. if sy-subrc eq 0. concatenate ‘The user ‘ NAME ‘ created successfully.’ into str1.
concatenate ‘The user ‘ NAME ‘ is not created. Technical issue!’ into
MSG = str1.
Now RFC Enabled Function Module ( also called RFC) has been create as SAP Service
Ref : Fig 4
Now we need to
create on Service Defination for this service which will be expose in SOAMANGER
Goto : Utilitiesà More Utilities–> Create Web Service à From the Function Module
Ref : Fig 5
It will open Configutaion Wizard . Provide Service Defination name different so that 3rd
Party application may not confiuse while trying to consume service( writing
some custom code) . Press “Continue”
Ref : Fig 6
Ref : Fig 7
Choose as below setting
Ref : Fig 8
Press “Complete”. Now check this configuration tab like this :
Ref : Fig 9
Change the Authontication Level as “Low”
Ref : Fig 10
Trasnport Sceurity should be low
Ref : Fig 11
Now expose the service form SOAMANAGER..
Serach your service
Goto Configuration tab and create Button
Ref : Fig 12
Check Basic Authontication
Ref : Fig 13
Press Save Button .. End point URL has been created
Ref : Fig 14
Test the service
Open Web Service Navigator
Ref : Fig 15
First provide WS
Navigator credentials and then SOAMANAGER USER and PASS
Fill the information and press Next
Ref : Fig 16
Check the export parametes Synchonous Communication. “The userbhati created successfully.”
Ref : Fig 17
Check the R3 table entry.
Ref : Fig 18
Please note ..
you can expose this service in service Registry. So that 3rd Party
application can directly consume this.