How to Create Web Services ABAP based
Using SAP XI/PI middleware we can create and expose WebServices, in this blog we are going to try to explain how an ABAP WebService can be created, exposed and tested only using ABAP.
First, we have to expose a Function Group as an Enterprise Service which is going to be ready to be called.
We’ll use Function Group Z_WEBSERVICE_TEST which has Function Module Z_CALCULO and we are going to expose it as an Enterprise Service.
We are using the wizard for Web Service creation.
Right click on the Function Group, then select Create -> Web Service
Write the Service Definition Name, a brief description and set the EndPoint as Function Group
We have to specify the Function Group name that is going to implement this Service Definition.
Select the Function Module.
Use the default profile called PRF_DT_IF_SEC_LOW to establish the lowest security profile in this Service Definition.
Make sure to check the field “Deploy Service”. If you don’t check the field, you can complete this step later manually from transaction code SOAMANAGER using the option for creating an EndPoint in ‘Configurations’ tab.
Check “Local Object” field to save the object locally (not transport)
In the final step choose the “Complete” option
Now that we have completed the previous step we can see the next screen where we can explore the service definition.
We have to enter to the trx. SOAMANAGER and choose the tab Application and Scenario Communication -> Single Service Administration.
We have to search the WS Definition that we created.
When we click on “Open WSDL Document for selected binding” a new windows pops up with the WSDL document:
The final WSDL file in now available.
With this, we have finished the creation of the WebService and it’s ready to be used for any external application.
Note: If you change some parameters in you function, you need to update it in the service definition. To do this go to trx. SE80 and select your previously created Service Definition and do a syntax check, then it will ask you if you want to correct the new parameters in the definition.
In the next chapter we are going to find how can we consume this WS using an ABAP proxy class.
What is the code of Z_Calculo?