How to configure a Service Consumer
To configure a consumer to access a particular service, you need to create and configure one or more logical ports.
A logical port is created for a specific consumer proxy to access one particular binding on the provider system.
You can create more than one logical port for the same consumer proxy. However, each logical port can point to only one binding.
The logical port is based on the WSDL document generated for a binding. The WSDL document describes how to access the binding, and includes the URLs for all the bindings defined for a service.
You can create a logical port based on a WSDL document or manually.
To use the WSDL based configuration the binding WSDL has to be used, not the design time WSDL. The binding WSDL can only be generated after a binding was created for the provider in transaction SOAMANAGER.
Depending on the way you choose to create a logical port, you need the following information:
Method to Create a Logical Port
What You Need to Know
Based on the WSDL document for a service
- From the main screen of SOA Manager, go to the Service Administration tab.
- Select Web Service Configuration.
- In the Search by menu, choose Consumer Proxy.
- In the Search Pattern field, specify a consumer proxy or a search string.
Here, we will use CO_SRT_TEST_PROVIDER.
- Select the row with the consumer proxy and choose Apply Selection.
Design-time information about the consumer proxy is displayed.
- Go to the Configurations tab.
An overview of logical ports is displayed if any have been created.
- To create a new logical port, choose Create.
A dialog box is displayed.
- Specify the following information for the new logical port.
Here, we will use the name CO_SRT_TEST_PROVIDER2.
- Select the configuration type WSDL-Based Configuration.
For WSDL-Based Configuration, the system extracts the binding URL from the WSDL document for the service.
Specify the WSDL access settings.
Here, use Via HTTP access. Additionally, you need to specify the path to the WSDL document and a user and password.
The user for WSDL Access needs to be authorized to access the WSDL in the system you are working in.
For URL for WSDL Access, you need the URL for the binding generated for the Web service provider.
- Choose Apply Settings.
A dialog box displays overview of bindings that could be used for this logical port.
- Select the appropriate binding for your logical port.
- Choose Apply Settings.
The logical port is now created in memory.
If an authentication method is used, go to the Consumer Security tab and specify a user and a password.
The user must have runtime access and application authorization.
The new logical port with the default settings is created and displayed in the overview.
- Optionally, you can check whether the logical port can access the binding by selecting the consumer proxy and choose Ping Web Service.
You now have created a logical port which can be used in your application to send a SOAP message to the respective Web Service Provider.
Example Application Code Snippet
To invoke a Web Service you could use the following code snippet as an example:
data lr_consumer_proxy type ref to co_my_consumer_proxy.
" instantiate consumer proxy
CREATE OBJECT lr_consumer_proxy
logical_port_name = 'MY_LOGICAL_PORT_NAME'.
" invoke WebService operation
lr_consumer_proxy->my_webservice_operation( ... ).
It's also possible to test the Consumer Proxy without creating a program, using transaction SE80. Follow these steps to trigger a test-call:
- Go to transaction SE80 and display the Consumer Proxy object (Edit Object > Enhanced Options > Enterprise Services > Client Proxy).
- Click on the Test (F8) button.
- On the selection screen specify the Logical Port and select the Method.
- Click on Execute (F8).
- With the XML Editor (Ctrl+F2) you can edit the input values of the request XML.
- To trigger the call, click on Execute (F8).