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
Erik IvarssonErik Ivarsson 

Error when calling web service behind firewall on intranet

Hi!
I'm trying to invoke a web service callout from Salesforce. The web service endpoint is a local Dell Boomi Atom that is stored behind a firewall, the firewall has been white listing the required IP ranges and has been configured to both SOAP and REST. I have tried with no luck connecting to this through my apex class that was generated through a WSDL, I get the error:
Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':html'


I have seen this on multiple issues here and most of the solutions I have found is that the firewall is not configured with the IP ranges, this should be the case for this firewall. Since I was unable to get any more information on this through the debug logs when doing a SOAP call I did one simple with REST:
public class WebServiceCallout { 
public static void callBoomi() { 
HttpRequest req = new HttpRequest(); 
HttpResponse res = new HttpResponse(); 
Http http = new Http(); 
req.setEndpoint('YYYYYYYYYYY:9090/ws/simple/queryHelloWorld'); 
req.setMethod('POST'); String a = 'Test='+EncodingUtil.urlEncode('Hej', 'UTF-8'); 
req.setBody(a); req.setCompressed(true); // otherwise we hit a limit of 32000 
req.setTimeout(120000); 
try { 
     res = http.send(req); 
     System.debug(res.getBody()); 
}catch(System.CalloutException e) { 
     System.debug('Callout error: '+ e); 
     System.debug(res.toString()); 
} 
} 
}
Since this is just a test web service to make sure that Salesforce can connect to Dell Boomi all this does is take a parameter 'Test' and returns 'Hello World' + Test. When I invoke this I see, what I assume is, the same response that I get from my SOAP request (the HTML page):User-added image
The server is up and running so it should not have timed out for that reason. Assuming that all IP ranges are white listed, I have added the endpoint as a remote site, is there something I have missed in Salesforce?
 
Erik IvarssonErik Ivarsson
I tried accessing it on port 443 with https://. I then received "System.CalloutException: IO Exception: Unexpected end of file from server". It takes really long time for the response, I would like to narrow it down to wheter or not this is an issue in my Salesforce setup or on the server side.