I am working on integrating Salesforce with SAP ECC using SAP PI as a middleware. For this, I have imported SAP WSDL in Salesforce to make a call to SAP PI.
Steps performed in Salesforce:
- Created an entry in Remote site setting with correct IP and port. e.g. https://121.XX.XX.111:8082
- Imported the SAP webservice and generated apex classes from the SAP/ PI WSDL.
- Created a Self-Signed certificate and added it on SAP/PI server.
- Got Salesforce IP ranges whitelisted on the network.
- While making a callout, set clientCertName_x = 'my_certificate_name'. set inputHttpHeaders_x = encoded_username_pwd_of_PI_server, used basic authentication.
Endpoint URL-1: https 121.XX.XX.111:8082/XISOAPAdapter/MessageServlet?senderParty=&senderService=SALESFORCE&receiverParty=&receiverService...
Error-1: System.CalloutException: IO Exception: java.security.cert.CertificateException: No subject alternative names matching IP address 121.XX.XX.111 found.
Few forum help suggested that, instead of making callout to IP address use hostname. Hence, using nslookup, we determined hostname of the corresponding IP and retried with below URL.
Endpoint URL-2: https static-111.XX.XX.121-tataidc.co.in:8082/XISOAPAdapter/MessageServlet?senderParty=&senderService=SALESFORCE&receiverService=&........
Error-2: System.CalloutException: IO Exception: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found"
Note that, when I test the connectivity to PI server from SOAP UI, request does reach the PI Server. However, request does not reach PI if it is made from Salesforce. Please suggest.