Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Test / activate a SOAP API

13,878

Hi! How I can test a SOAP API with S/4H or SOAPUI?

I have the wsdl file but I don't know how to test or activate. Please, help me!!

I tried to create a service in SE80 but produces an excepction "CX_PROXY_GEN_ERROR".

From SOAP UI load the file but doesn't have the endpoint. I suppose that have to create it but I don't know how.

Someday, I created a web service SOAP using the FM "READ_EXCHANGE_RATE". In this case, with API SOAP I need to test/activate the API "Exchange Rates A2X".

Can anybody help me with an example?

1 ACCEPTED SOLUTION
Read only

Edrilan_Berisha
Product and Topic Expert
Product and Topic Expert
12,900

If you want to test a SOAP API in a compliant way, use Postman instead of SOAPUI (unless you have the pro version license for that)

I wrote a blog post for this:

https://blogs.sap.com/2021/08/04/calling-a-soap-api-using-postman/

Best,

Edrilan Berisha

SAP S/4HANA Cloud Development Financials


2 REPLIES 2
Read only

Edrilan_Berisha
Product and Topic Expert
Product and Topic Expert
12,901

If you want to test a SOAP API in a compliant way, use Postman instead of SOAPUI (unless you have the pro version license for that)

I wrote a blog post for this:

https://blogs.sap.com/2021/08/04/calling-a-soap-api-using-postman/

Best,

Edrilan Berisha

SAP S/4HANA Cloud Development Financials


Read only

serafim789
Newcomer
11,598

To test and activate a SOAP API, especially in an SAP S/4HANA environment or using SOAPUI, here’s a step-by-step guide to help you out:

1. Understanding the Scenario:
You want to test a SOAP API https://tech-stack.com/blog/what-is-an-api/ , specifically the "Exchange Rates A2X" API, using the WSDL file. You've encountered issues with creating a service in SE80 in SAP and are trying to set up the endpoint in SOAPUI.

2. Testing the SOAP API with SOAPUI:
Step 1: Import the WSDL File
Open SOAPUI: Launch SOAPUI on your machine.
Create a New SOAP Project:
Go to File > New SOAP Project.
Enter a name for your project.
Under the Initial WSDL field, browse and select your WSDL file.
Click OK.
Review the Project Structure: Once the WSDL is loaded, SOAPUI will generate a project structure with all available operations and request templates.
Step 2: Set Up the Endpoint
Locate the Service: In the project structure, expand the service to view the operations.
Set the Endpoint:
Click on any request under the operation to open the request editor.
If the WSDL does not contain the endpoint, you need to manually specify it.
Enter the SOAP endpoint URL in the request editor where it says <Endpoint> or in the endpoint field at the top of the request editor.
The endpoint URL usually looks something like: http://<hostname>:<port>/sap/bc/srt/rfc/sap/<service_name>/...
Step 3: Configure Authentication (if needed)
Basic Authentication: If the SOAP API requires authentication:
Click on the Auth tab in the request editor.
Select Add New Authorization.
Choose Basic and enter the SAP user credentials.
Step 4: Send the Request
Modify the Request Payload: Customize the request payload according to the operation you want to test.
Send the Request: Click the green Play button to send the request.
View the Response: Check the response in the right panel to see if the API returns the expected data.
3. Activating the SOAP API in SAP S/4HANA:
If you're trying to activate a SOAP service in SAP and encountered an error in SE80, try the following steps:

Step 1: Check and Generate the Service in SE80
Go to SE80: Enter SE80 (Object Navigator) in SAP.
Select the Package: Find the package where you want to create the service.
Create the Service:
Right-click on the package, select Create > Enterprise Service.
Use the Proxy Object Type you need.
Follow the wizard to create the service. If you get CX_PROXY_GEN_ERROR, make sure all related objects are properly activated and consistent.
Step 2: Activate the Service in SOAMANAGER
Open SOAMANAGER: Go to Transaction SOAMANAGER in SAP.
Web Service Configuration: Navigate to the Web Service Configuration tab.
Search for the Service:
Enter the service name and search for it.
Activate the Service:
Once found, activate the service.
You can also manage endpoints and other configurations here.
Step 3: Testing via SAP
Test Service:
Use the Test function in SOAMANAGER to test the SOAP service.
You can also test the service from the SAP GUI using Transaction SE37 for Function Modules.
4. Testing Exchange Rates A2X API
If you’re specifically testing the "Exchange Rates A2X" API:

Load the corresponding WSDL in SOAPUI.
Set up the endpoint as described.
Send a request with the necessary input parameters related to exchange rates.
5. Troubleshooting Tips:
Endpoint Not Found: If the endpoint is missing or incorrect, verify it in SOAMANAGER.
CX_PROXY_GEN_ERROR: This error might be due to issues in the service definition or inactive objects. Check for consistent activation.
Missing Authentication: Ensure that the proper authentication method is set up in SOAPUI.
This should give you a complete overview of how to test and activate your SOAP API. Let me know if you need more specific details or if any issues arise during the process!