In this recipe, we will see how we can create a client proxy based on a given Web service (using its WSDL document). As an example, we will use the Web service that we created earlier in this chapter. We will use the Web service wizard from the transaction SE80
. This will generate the class and other necessary objects that are needed to call the Web service.
We will now follow the steps as shown:
SE80
, and select the menu option Edit Other Object.SOAMANAGER
transaction.ZST8_
. Then click on Continue.This will create the service consumer proxy as shown in the following screenshot. The proxy by the name ZST8_CO_ZST8_MYSERVICE is created. The relevant class corresponding to the proxy is also generated and activated along with the necessary methods.
The method contains the necessary logic for converting the amount based on the function module used while defining. The input structure corresponds to the importing parameters, whereas the output structure corresponds to the exporting parameters of the function module used for generating the Web service. All the necessary objects are generated. In addition, the relevant structures needed for the Web service call (consumer proxy method call) are also generated.
In the next recipe, we will see how to create a logical port for the Web service consumer. After this, the service may be called from a program using the proxy class methods.
Apart from WSDL URL, you may use other options as the source of your web service. You may use a local file that contains the WSDL document pertaining to the service or the enterprise service repository of a PI instance. In addition, a UDDI registry (maintained on the SAP server that provides access to information about published Web services) may also be specified.
Alternatively, a more sophisticated Service Registry may be used as the source. The service registry is a UDDI v3 complaint registry within an SOA landscape. It may have services published from activated service interfaces from ESR, or from sender agreements from Integration Directory. Also, it may be used on ABAP or Java services definitions from AS, ABAP, or Java, respectively. They provide important information about services along with the reference to WSDL data. After entering the name of the UDDI registry or service registry the name of the relevant service may then be specified on the next screen.
3.138.117.75