You need to sign in to do that
Don't have an account?
aditya prasad
Get error: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found"
Hi,
I need to read some data from an external site and once I get respnse, will update records based on the data.
My code:
I need to read some data from an external site and once I get respnse, will update records based on the data.
My code:
Accolade__c accoladeSettings = Accolade__c.getOrgDefaults();
HTTP h = new HTTP();
HTTPRequest r = new HTTPRequest();
Blob headerValue = Blob.valueOf(accoladeSettings.Username__c + ':' + accoladeSettings.Password__c);
String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
system.debug('Authorization header'+headerValue);
r.setHeader('Authorization', authorizationHeader);
r.setMethod('GET');
r.setTimeout(120000);
String baseEndPoint = accoladeSettings.Url1__c;
baseEndPoint +='9726'+accoladeSettings.Url2__c;
r.setEndpoint(baseEndPoint);
HTTPResponse resp = new HTTPResponse();
resp = h.send(r);
But I get Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found" for resp = h.send(r);
I have asked thirdparty to whitelist salesforce Ips.
But is there any other way we can overcome this error. How to achieve same functionality using SOAP? I am unawarte of SOAP, any help is very much appreciated.
Thanks,
Aditya
HTTPRequest r = new HTTPRequest();
Blob headerValue = Blob.valueOf(accoladeSettings.Username__c + ':' + accoladeSettings.Password__c);
String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
system.debug('Authorization header'+headerValue);
r.setHeader('Authorization', authorizationHeader);
r.setMethod('GET');
r.setTimeout(120000);
String baseEndPoint = accoladeSettings.Url1__c;
baseEndPoint +='9726'+accoladeSettings.Url2__c;
r.setEndpoint(baseEndPoint);
HTTPResponse resp = new HTTPResponse();
resp = h.send(r);
But I get Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found" for resp = h.send(r);
I have asked thirdparty to whitelist salesforce Ips.
But is there any other way we can overcome this error. How to achieve same functionality using SOAP? I am unawarte of SOAP, any help is very much appreciated.
Thanks,
Aditya
Thanks,
Aditya
You have to use either a Named Credential or add the EndPoint URL to Remote Site Settings under "Security Controls" to make it available for Salesforce.
Let me know if this helps.
And also added under Remote Site setting as well. If don't add it , it will ask me to add it. So that is not an issue.