In this recipe, we will see how we can create a Web service using a Web service creation wizard from a remote-enabled function module. The function module simply takes as input an amount (in figures, for example, 1000) and currency such as USD, and then outputs the corresponding amount in words such as One Thousand US Dollars (similar to the function module SPELL_AMOUNT).
Since the SPELL_AMOUNT function module is not remote-enabled, it cannot be used for generating a Web service. One such attempt will result in the following error during creation of the service.
So, we will copy the function module SPELL_AMOUNT and rename it as ZST8_MY_SPELL_AMOUNT and make the copy remote-enabled after making necessary changes in the interface. In this recipe, we will use our remote-enabled function module as the basis for creation of a Web service. The function group containing this function module was created by the name ZST8_SPELL.
We will now follow the steps as shown:
SE80
. From the list of the local objects of your user ID, we select the root node and right-click to access the context menu. We then navigate to Create | Enterprise Service.PRF_DT_IF_SEC_NO
in the Profile field. Then click on the Next button.We first created a remote-enabled function module that was used for creation of the Web service. The essential steps that we need to carry out for creation of a Web service are done using the wizard. The approach we follow is the Inside-Out approach. We used a function module as the basis of our Web service—the endpoint. The wizard guides us through the various steps and essentials for creating a service provider. The Web service is created by the name ZST8_MYSERVICE, as specified. We did not keep any authentication for the Web service.
This web service has been created but cannot be called yet. Now we need to make this configuration of the Web service created. The runtime configuration needs to be undertaken via transaction SOAMANAGER
. We will do this in the next recipe.
Instead of the path shown in the recipe, we may use transaction SE37
, which directly creates creating a Web service. From inside the Function Builder, navigate to Utilities | More Utilities | Ceate Web Service.
An alternate path is to go to transaction SE80
and then navigate to Edit | Other Object. Then choose the tab Enterprise Services. Now, enter a name in the Service Definition field and click on the Create button.
On the Security Settings profile screen, we choose PRF_DT_IF_SEC_NO (meaning without authentication and no transport guarantee). There are three other possibilities:
PRF_DT_IF_SEC_LOW
: Authentication with user ID and password but no transport guaranteePRF_DT_IF_SEC_MEDIUM
: Authentication with user ID and password as well as transport guaranteePRF_DT_IF_SEC_HIGH
: Authentication with certificates as well as transport guarantee13.58.51.36