• Pankaj Singh 196
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hi All,
I am getting below give error while executing code from execute window in Salesforce.

"System.CalloutException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 503 Service Unavailable" 

**Code :** 

    Http http = new Http();
    HttpRequest request = new HttpRequest();
    request.setEndpoint('https://integration-qa.al-enterprise/presales-qa/post/v1.0/validatePos.com');
    request.setMethod('POST');
    request.setHeader('Content-Type', 'application/json;charset=UTF-8');
    
    // Set the body as a JSON object
    request.setBody('{"posId":"POS_Partner_004"}');
    
    HttpResponse response = http.send(request);
    
    // Parse the JSON response
    if (response.getStatusCode() != 201) {
        System.debug('The status code returned was not expected: ' +
            response.getStatusCode() + ' ' + response.getStatus());
    } else {
        System.debug(response.getBody());
    }

I tried with some other codes as well (having basic auth) but always got same error on this line "**HttpResponse response = http.send(request);**"

I searched over net to resolve it but didn't worked. Kindly help. 
Also help on below points.

1) Do i need to provide signed certificate to Mulesoft.

2) Do i need to put any security certificate in Salesforce received from Mulesoft. Would it be CA signed or Import from Keystore kind.

3) I have already set remote site setting in Salesforce.

4) Proxy opened for all websites.

5) End Point ULR not working in POSTMAN , When checked with Mulesoft they said its because of whitelist issue. There end point URL is perfectly fine.

What is exact way to connect from Salesforce to Mulesoft using REST API and how to POST/GET data.

Thanks Alot!!!

 
1) I need to read the data from excel file, so that i could populate few important data out of it on the Salesforce UI..
2) I need to count number of columns in an Excel. So that i could put a validation that a file "should not have more and less than 20 columns".

Further, i need to convert Excel data into Json format.
 
Hi All,
I am getting below give error while executing code from execute window in Salesforce.

"System.CalloutException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 503 Service Unavailable" 

**Code :** 

    Http http = new Http();
    HttpRequest request = new HttpRequest();
    request.setEndpoint('https://integration-qa.al-enterprise/presales-qa/post/v1.0/validatePos.com');
    request.setMethod('POST');
    request.setHeader('Content-Type', 'application/json;charset=UTF-8');
    
    // Set the body as a JSON object
    request.setBody('{"posId":"POS_Partner_004"}');
    
    HttpResponse response = http.send(request);
    
    // Parse the JSON response
    if (response.getStatusCode() != 201) {
        System.debug('The status code returned was not expected: ' +
            response.getStatusCode() + ' ' + response.getStatus());
    } else {
        System.debug(response.getBody());
    }

I tried with some other codes as well (having basic auth) but always got same error on this line "**HttpResponse response = http.send(request);**"

I searched over net to resolve it but didn't worked. Kindly help. 
Also help on below points.

1) Do i need to provide signed certificate to Mulesoft.

2) Do i need to put any security certificate in Salesforce received from Mulesoft. Would it be CA signed or Import from Keystore kind.

3) I have already set remote site setting in Salesforce.

4) Proxy opened for all websites.

5) End Point ULR not working in POSTMAN , When checked with Mulesoft they said its because of whitelist issue. There end point URL is perfectly fine.

What is exact way to connect from Salesforce to Mulesoft using REST API and how to POST/GET data.

Thanks Alot!!!

 
Hi guys,

Does anyone know why a REST API call to salesforce end up to "503 Service unavailable"?

Following is the error message sent by salesforce to our application:
15:18:14,914 WARN [org.springframework.web.client.RestTemplate] (default task-11) GET request for "https://na30.salesforce.com/services/data/v23.0/chatter/users/me" resulted in 503 (Service Unavailable); invoking error handler
15:18:14,929 SEVERE [com.silanis.esl.web.exception.mappers.ThrowableMapper] (default task-11) No error details from Salesforce.: org.springframework.social.UncategorizedApiException: No error details from Salesforce.
at org.springframework.social.salesforce.api.impl.SalesforceErrorHandler.handleUncategorizedError(SalesforceErrorHandler.java:60) [spring-social-salesforce-1.1.7.1.jar:]
at org.springframework.social.salesforce.api.impl.SalesforceErrorHandler.handleError(SalesforceErrorHandler.java:28) [spring-social-salesforce-1.1.7.1.jar:]
at org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:566) [spring-web-3.2.13.RELEASE.jar:3.2.13.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:524) [spring-web-3.2.13.RELEASE.jar:3.2.13.RELEASE]

Thanks,
Andry