cancel
Showing results for 
Search instead for 
Did you mean: 

Calling OData services in SAP Digital Mnaufacturing

harsh-ctrl
Participant
0 Kudos
852

Hi experts,

I am trying to call an OData API in SAP DM. I have followed Create an API Service (RESTful and OData) | SAP Help PortalManage Web Servers | SAP Help Portal and Configure Client Proxy for Third-Party Service | SAP Help Portal blogs to do so. I am unable to call the API and the error that comes up is - “ErrorMessage created with value Query failed with NXDOMAIN". The configs that I've done are - 
 

In Manage Web server apps - I have created a new web server, added the destinations, added Host URL(as mentioned in DEST config), consumed in DMC_Cloud and used this in a service - 

harshctrl_0-1720514091412.png

In the manage service registry app, I have created a new service under "API service" and provided the URL/Path and other important details in the overview section. I have also checked by providing/not providing the host URLs in web server and the api service. I get the same errors on all scenarios - 

harshctrl_1-1720514370359.png

When I'm trying to call this service in a production process I get the following error in the logs - 

harshctrl_2-1720514509906.png

Note: The blacked-out parts in the screenshots are the destination names and URLs. I have checked and it's the same in DM and destination config. Also, I checked this in Postman, and there as well I'm getting the same issue - "Error: getaddrinfo ENOTFOUND <DEST_NAME>"


Question: Am I following the right process to call an OData service in DM? If not, then what's the alternative to this approach? If yes, then what am I missing in this config that I'm getting this issue? 

Any help will be of great value.

Thanks & Regards,
Harsh.







View Entire Topic
ManoelCosta
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Is the http://{host}:{port} you are using correct and accessible?

If it doesn´t work from Postman either, it´s most probably an issue with your API URL or Authorization configs, not necessarily with your DM setup.

I suggest you review API_PRODUCTION_ORDER_2_SRV from Business Accelerator Hub and double check if you are using a valid and accessible url and a working authorization method, which must work from both Postman as well as from DM.

Br,
Manoel

harsh-ctrl
Participant
0 Kudos

Hi @ManoelCosta,

Yes, the http://{host}:{port} we are using is correct and accessible. We have cross-checked the destination details in Business Settings of DM, and also with the Basis team. The destination setup seems to be right and working. 

The API that we are trying to hit is active and accessible in SAP Gateway. It also returns the data properly on Postman when triggered using the IP address of the On-Prem System. Only when using the web server and other setups in DM I'm unable to get any response from the API. I've also raised an OSS ticket to address this issue.

My main concern was that am I using the right process to call an ODATA API or not. 

Thanks & Regards,
Harsh.

marcobarat
Participant
0 Kudos

Comment removed because i've added it as answer.

cicero1988
Explorer
0 Kudos
Hello, I am facing the same error, could you tell me how it was resolved? I am trying to connect DM to my S4/Hana and I am facing a 401 error
marcobarat
Participant

@cicero1988 for your issue:

- check user and password on SAP BTP destination, check that they are working fine
- second check: check inside your production process that the destination has been selected!

Let me know 

marcobarat_0-1745656024643.png

 

marcobarat_1-1745656024717.png