function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amol ChAmol Ch 

System.Callout Exception Unexpected end of file from server

I am integration salesforce with SAP system using SOAP API. SAP Provided the Username and Password. So I have created a NamedCreditials in salesforce and used that in my apex class as endpoint.

public String endpoint_x ='callout:SAP_Callout';

AS per salesforce doc we have whitelisted the Salesforce IP ranges in Firewall on SAP End.
But during callout, still we are getting Error,

System.Callout Exception Unexpected end of file from server

Named Credentials: 

Snapshot of IP ranges which is configured in firewall.

User-added imageUser-added imageUser-added imageUser-added image
Ashish DevAshish Dev
did you created remote site setting for sap endpoint?
Amol ChAmol Ch
Hi Ashish, Yes i have created remote site settings. But i think when we create named credentials then no need of remote site setting. And i am using named credentials.
Ashish DevAshish Dev
just to make sure it is not firewall issue can you whitelist all ip ranges in sap?
also is there any loggin at sap site which tell if a call from salesforce was blocked?
Amol ChAmol Ch
Yes, We have whitelisted the all IP addresses provided by salesforce for our region. I've attached the snapshots in the question. 

SAP has a login at their end. They provided the Username and password. And thus I'm using Named credentials. In Named credentials, I've added the Username and Password and Remote URL.(

How we can check, on SAP end it was blocking the call from salesforce.