-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
5Likes Given
-
22Questions
-
46Replies
A small and simple doudt iam not able to understand regarding salesforce user interface
the original template of salesforce is :
may i know why iam not getting the standard header in salesforce
- sony sonu
- April 22, 2019
- Like
- 0
- Continue reading or reply
visualforce page of salesforce
- sony sonu
- July 05, 2018
- Like
- 0
- Continue reading or reply
did any body worked on platform cache in salesforce
- sony sonu
- June 07, 2018
- Like
- 0
- Continue reading or reply
REST CALLOUTS VISUALFROCE PAGE
public class AnimalsCallouts { public static HttpResponse makeGetCallout() { Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals'); request.setMethod('GET'); HttpResponse response = http.send(request); // If the request is successful, parse the JSON response. if (response.getStatusCode() == 200) { // Deserializes the JSON string into collections of primitive data types. Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody()); // Cast the values in the 'animals' key as a list List<Object> animals = (List<Object>) results.get('animals'); System.debug('Received the following animals:'); for (Object animal: animals) { System.debug(animal); } } return response; } public static HttpResponse makePostCallout() { Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals'); request.setMethod('POST'); request.setHeader('Content-Type', 'application/json;charset=UTF-8'); request.setBody('{"name":"mighty moose"}'); 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()); } return response; } }HOW TO CREATE A VISUALFORCE PAGE FOR THIS APEX CLASS??? WITH TWO BUTTONS OF POST AND GET????
THANKS >>>
- sony sonu
- May 23, 2018
- Like
- 0
- Continue reading or reply
salesforce basics, executing in anonymous window
public class restapijava{ public void add(){ integer x = 10; integer y =20; integer z = x+y; system.debug(z); } public static void main(string[] args){ restapijava referncer = new restapijava(); referncer.add(); } }how can i call it in the anonymous window..??
- sony sonu
- May 10, 2018
- Like
- 0
- Continue reading or reply
rest callouts through local server
All i need to do is retrieve values from external application . When i tried to use the Chrome APP 'Advanced Rest Client' and have passed the appropriate URL format in the form of POST methoed I was able to retrieve the values from local server database.
For EG : If i pass 92126 then i was able to get 'SAN DIEGO' which is correct.
Here is the link (https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)for Advanced REST Client.
PROBLEM from Salesforce :
2) When i created this REST class in SAlesforce and tried invoking the End Point then its throwing this error.
System.HttpResponse[Status=Service Unavailable, StatusCode=503]
saved the url site in remote site setting also,, as salesforce ip address are dyamically changing everytime ....our network engineers are refusing to add/whitelist too many ip address in the local server.. instead they are asking to provide 2 ip address ..what will be your suggestion ...
- sony sonu
- May 09, 2018
- Like
- 0
- Continue reading or reply
rest callouts to external application through a local server..
https://developer.salesforce.com/forums/?id=906F0000000Af3aIAC
i have the problem with the same scenario in rest callouts ,, as in the comments they had suggested to add /whitelist the salesforce ip address , to the network engineers ..so there are so many ip ranges in the salesforce because it is static ...as we are using ap5, they are willing to add the 2 static ip address in the server ..may i know how to resolve this issue... there are so many ip address with ranges ,?? what will be the solution to suggest the network engineers..
- sony sonu
- May 09, 2018
- Like
- 0
- Continue reading or reply
rest call out using javascript not getting error 401 but executing in anonymous window
<apex:page> <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> <script> function Callout() { var JSONResponse = ''; var JsonBody = ''; JsonBody = '{"capital ": "delhi"}'; console.log('--JsonBody ------->'+JsonBody ); var xhr = new XMLHttpRequest(); xhr.open("POST", "http://myendpointxxxxr", true); <!-- xhr.setRequestHeader("Authorization","Bearer {!AccessToken}" ); --> xhr.setRequestHeader("Content-type", "application/json;charset=UTF-8"); xhr.onload = function () { JSONResponse = xhr.responseText; console.log('--JSONResponse ------->'+xhr.responseText); }; xhr.send(JsonBody); setTimeout( function() { if(xhr.status == 404){ } else if(xhr.status == 401){ } else if(xhr.status == 500){ } else if(xhr.status == 200) { obj1 = JSON.parse(JSONResponse ); for(var x=0;x< obj1.length;x++) { var singleEle = obj1[x]; console.log('--singleEle ------->'+singleEle ); } } }, 2000); } </script> <apex:form> <apex:pageBlock> <apex:pageBlockButtons location="Top"> <button type="button" onclick="Callout();" style="height:22px; width:150px" > Make Callout </button> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
iam getting the below errror :Failed to load resource: the server responded with a status of 404 (Not Found). any wrong in the code
- sony sonu
- May 08, 2018
- Like
- 0
- Continue reading or reply
CANT MAKE A REST CALLOUT FORM SALESFORCE
All i need to get response from sap application through the rest callouts . When i tried to use the Chrome APP 'Advanced Rest Client' and postman have passed the appropriate URL and Content with GET AND POST method I was able to retrieve the values from local server database.
For EG : If i pass request 92126 then i was able to get response 'SAN DIEGO' which is correct.
Here is the link (https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)for Advanced REST Client.
1)i had created a remotesite setting
2) When i created this REST class in SAlesforce and tried invoking the End Point then its throwing this error.
System.HttpResponse[Status=Service Unavailable, StatusCode=503]
# as the web api url which is provided to us is in local sql server i.e hosted in private, as we know THAT salesforce for making callouts the urls must be EXPOSED in public... bt the url is in private only for the security reasons not hosted in public..we should achieve iT COMPULSARY THERE WILL A ANY SOLUTION FOR ALL THE QUESTIONS .. IS any way is there to acheive it ?? ..what changeS should be done in salesforce or LOCAL server to communicate to eachother ..and allows to make the callout ???
- sony sonu
- May 07, 2018
- Like
- 0
- Continue reading or reply
rest callout through salesforce to .net application
Now this endpoint url is in client network. We are passing URLs in client network which works fine.
i have configured the endpoint under Remote Site settings and trying to send the request as POST AND GET method to the endpoint via Apex class. I am getting 503 Service Unavailable response and the description of the body says 'Unable to determine IP address from host name'.
Since we this is just a HTTP URL , i tried creating a custom link and tried invoking the URL which works fine within the same app.
So I am not sure when I am able to access the endpoint URL via custom link within the app then why I am unable to access the same endpoint via Apex class?
Any suggestions would be highly appreciated.
- sony sonu
- May 07, 2018
- Like
- 0
- Continue reading or reply
connecting to localserver form salesforce
actually out cilent requirement is to connect the local server from salesfroce and make the callouts .. actually localserver is private right so it wont allows the localserver to connect with the local server ..any alternative procedure..they are ready to provide all the data for connecting to local server to salesforce... any idea about that please let me know... 1st we want to connect to server ...for eliminating the 503 service unavailble error///..
there will be the alternate procedure with the experts..please let meknow
- sony sonu
- May 07, 2018
- Like
- 0
- Continue reading or reply
how to have the authentication with salesforce to locally hosted sqlserver
- sony sonu
- May 04, 2018
- Like
- 0
- Continue reading or reply
how to authenticate salesforce to local server???????
- sony sonu
- May 04, 2018
- Like
- 0
- Continue reading or reply
How to make the IP address of my salesforce instance as static..any alternate procedure for that???
While doing an integration with SAP there are firewall and local server issues.To avoid this they were asking me the salesforce static IP for my organization.
So how can i know the IP Address of my instance, its a developer org. Is it possible to find by salesforce logged in URL? i had gone through the below link ,
https://help.salesforce.com/apex/HTViewSolution?id=000003652
APAC, you need to whitelsit these IP ranges
182.50.76.0 - 182.50.79.254
202.129.242.0 - 202.129.243.254
96.43.144.0 - 96.43.159.254
136.146.0.0 - 136.147.255.254
204.14.232.0 - 204.14.239.254
these are all whitelsit these IP ranges, but i need the static address to add in the local server .for the accessing the local server for callouts coming form the ip address as they added...
Please suggest me with your ideas, Thanks in advance.
- sony sonu
- May 03, 2018
- Like
- 0
- Continue reading or reply
How to find the Port number for my Salesforce instance
As am doing an integration with SAP which is hosted on local server, Netowrk team asking me about IP's and Port's.
Already provided IP Addresses but not able to provide Port numbers. So how can i know the port number for my instance( https://ap5.salesforce.com )
Your help is higly appreciated, Thanks in advance.
- sony sonu
- May 02, 2018
- Like
- 0
- Continue reading or reply
rest callouts
public static pageReference makeGetCallout() {
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('http://www.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
request.setMethod('GET');
HttpResponse response = http.send(request);
// If the request is successful, parse the JSON response.
if (response.getStatusCode() == 200) {
// Deserializes the JSON string into collections of primitive data types.
Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
List<Object> values = (List<Object>) results.get('values');
System.debug('Received the following values:');
for (Object value: values) {
System.debug(value);
}
}
return null;
}
public static pageReference makePostCallout() {
String S ='{"Deduction": [{"Cxatxegoxry_Tyxpe": "xV","xxx": 125.00}],"isOxxnlinexxxxxr": true}';
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint(' http://xxxxxxxxxxxxxxxxxxxxxxxxxx');
request.setMethod('POST');
request.setHeader('Content-Type', 'application/json;charset=UTF-8');
request.setHeader('ip', '2xxxxxxxxxx');
request.setBody('S');
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());
}
return null;
}
}
v.f page is :
<apex:page controller="Callouts" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:commandButton value="GET" action="{!makeGetCallout}"/>
<apex:commandButton value="POST" action="{!makePostCallout}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
iam not getting the response on clicking the button may i know where is the mistake?
- sony sonu
- April 27, 2018
- Like
- 0
- Continue reading or reply
which edition is best for the rest api callouts ...professional or enterprise edition???
let me know why???
- sony sonu
- April 26, 2018
- Like
- 0
- Continue reading or reply
Is developer edition is already tls1.1 and tls1.2 enabled....or any other way to enable it in develpr org
Is developer edition is already tls1.1 and tls1.2 enabled....or any other way to enable it in develpr org??
- sony sonu
- April 24, 2018
- Like
- 0
- Continue reading or reply
callout error :TLSv1
may i know how i can be acheived in developer edition ??????
Environment : developer edition
I am using callout to pull the data from api to Salsesforce. It was working bfore. Today I ran the apex callout and got the following error
System.CalloutException: Server chose TLSv1, but that protocol version is not enabled or not supported by the client
Then I checked Internet about this error and came to know that salesforce disabled TLS 1.0. I also got some information TLS 1.0 Disablement Critical Update Console (CRUC) Setting. But unfortunately am not able to see that Require TLS 1.1 or higher for HTTPS connections in CRUC.
- sony sonu
- April 24, 2018
- Like
- 0
- Continue reading or reply
callouts form salesfroce to .net application
- sony sonu
- April 23, 2018
- Like
- 0
- Continue reading or reply
did any body worked on platform cache in salesforce
- sony sonu
- June 07, 2018
- Like
- 0
- Continue reading or reply
REST CALLOUTS VISUALFROCE PAGE
public class AnimalsCallouts { public static HttpResponse makeGetCallout() { Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals'); request.setMethod('GET'); HttpResponse response = http.send(request); // If the request is successful, parse the JSON response. if (response.getStatusCode() == 200) { // Deserializes the JSON string into collections of primitive data types. Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody()); // Cast the values in the 'animals' key as a list List<Object> animals = (List<Object>) results.get('animals'); System.debug('Received the following animals:'); for (Object animal: animals) { System.debug(animal); } } return response; } public static HttpResponse makePostCallout() { Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals'); request.setMethod('POST'); request.setHeader('Content-Type', 'application/json;charset=UTF-8'); request.setBody('{"name":"mighty moose"}'); 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()); } return response; } }HOW TO CREATE A VISUALFORCE PAGE FOR THIS APEX CLASS??? WITH TWO BUTTONS OF POST AND GET????
THANKS >>>
- sony sonu
- May 23, 2018
- Like
- 0
- Continue reading or reply
salesforce basics, executing in anonymous window
public class restapijava{ public void add(){ integer x = 10; integer y =20; integer z = x+y; system.debug(z); } public static void main(string[] args){ restapijava referncer = new restapijava(); referncer.add(); } }how can i call it in the anonymous window..??
- sony sonu
- May 10, 2018
- Like
- 0
- Continue reading or reply
CANT MAKE A REST CALLOUT FORM SALESFORCE
All i need to get response from sap application through the rest callouts . When i tried to use the Chrome APP 'Advanced Rest Client' and postman have passed the appropriate URL and Content with GET AND POST method I was able to retrieve the values from local server database.
For EG : If i pass request 92126 then i was able to get response 'SAN DIEGO' which is correct.
Here is the link (https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)for Advanced REST Client.
1)i had created a remotesite setting
2) When i created this REST class in SAlesforce and tried invoking the End Point then its throwing this error.
System.HttpResponse[Status=Service Unavailable, StatusCode=503]
# as the web api url which is provided to us is in local sql server i.e hosted in private, as we know THAT salesforce for making callouts the urls must be EXPOSED in public... bt the url is in private only for the security reasons not hosted in public..we should achieve iT COMPULSARY THERE WILL A ANY SOLUTION FOR ALL THE QUESTIONS .. IS any way is there to acheive it ?? ..what changeS should be done in salesforce or LOCAL server to communicate to eachother ..and allows to make the callout ???
- sony sonu
- May 07, 2018
- Like
- 0
- Continue reading or reply
rest callout through salesforce to .net application
Now this endpoint url is in client network. We are passing URLs in client network which works fine.
i have configured the endpoint under Remote Site settings and trying to send the request as POST AND GET method to the endpoint via Apex class. I am getting 503 Service Unavailable response and the description of the body says 'Unable to determine IP address from host name'.
Since we this is just a HTTP URL , i tried creating a custom link and tried invoking the URL which works fine within the same app.
So I am not sure when I am able to access the endpoint URL via custom link within the app then why I am unable to access the same endpoint via Apex class?
Any suggestions would be highly appreciated.
- sony sonu
- May 07, 2018
- Like
- 0
- Continue reading or reply
connecting to localserver form salesforce
actually out cilent requirement is to connect the local server from salesfroce and make the callouts .. actually localserver is private right so it wont allows the localserver to connect with the local server ..any alternative procedure..they are ready to provide all the data for connecting to local server to salesforce... any idea about that please let me know... 1st we want to connect to server ...for eliminating the 503 service unavailble error///..
there will be the alternate procedure with the experts..please let meknow
- sony sonu
- May 07, 2018
- Like
- 0
- Continue reading or reply
rest callouts
public static pageReference makeGetCallout() {
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('http://www.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
request.setMethod('GET');
HttpResponse response = http.send(request);
// If the request is successful, parse the JSON response.
if (response.getStatusCode() == 200) {
// Deserializes the JSON string into collections of primitive data types.
Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
List<Object> values = (List<Object>) results.get('values');
System.debug('Received the following values:');
for (Object value: values) {
System.debug(value);
}
}
return null;
}
public static pageReference makePostCallout() {
String S ='{"Deduction": [{"Cxatxegoxry_Tyxpe": "xV","xxx": 125.00}],"isOxxnlinexxxxxr": true}';
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint(' http://xxxxxxxxxxxxxxxxxxxxxxxxxx');
request.setMethod('POST');
request.setHeader('Content-Type', 'application/json;charset=UTF-8');
request.setHeader('ip', '2xxxxxxxxxx');
request.setBody('S');
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());
}
return null;
}
}
v.f page is :
<apex:page controller="Callouts" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:commandButton value="GET" action="{!makeGetCallout}"/>
<apex:commandButton value="POST" action="{!makePostCallout}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
iam not getting the response on clicking the button may i know where is the mistake?
- sony sonu
- April 27, 2018
- Like
- 0
- Continue reading or reply
API returning 503 Service Unavailable, although the server never receives a request from Salesforce.
Unable to tunnel through proxy. Proxy returns "HTTP/1.0 503 Service Unavailable"
The API is actually not receiving any request on the server side, so they are unable to help. Thus asking if someone else has had a similar issue and a viable solution for the same.
- Pankaj Verma 12
- April 18, 2016
- Like
- 1
- Continue reading or reply
503 service unavailable error when try to connect to connect to https://login.salesforce.com/services/Soap/c/13.0
I am able to succesfully connect to below URL using SOAP::Lite
http://login.salesforce.com/services/Soap/c/13.0
but I get 503 service unavailable error when I try to connect to https://login.salesforce.com/services/Soap/c/13.0 .
What can be the reason?
Thanks
Bhushan
- Bhushan Laddad
- December 09, 2015
- Like
- 0
- Continue reading or reply
REST API Integration Issue. - System.HttpResponse[Status=Service Unavailable, StatusCode=503]
I will try to frame my question in short.
End Goal : REST API Integration from Salesforce to a InHouse Lead Management System(LMS2)
SUCCESS Through Chrome APP
1. All i need to do is retrieve values from LMS2. When i tried to use the Chrome APP 'Advanced Rest Client' and have passed the appropriate URL and Content in XML/TEST format in the form of POST methoed I was able to retrieve the values from LMS2 database.
For EG : If i pass 92126 then i was able to get 'SAN DIEGO' which is correct.
Here is the link (https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)for Advanced REST Client.
PROBLEM from Salesforce :
2) When i created this REST class in SAlesforce and tried invoking the End Point then its throwing this error.
System.HttpResponse[Status=Service Unavailable, StatusCode=503]
public with sharing class LmsRestApiIntegration {
//LmsRestApiIntegration.invokeRestAPI()
@future(callout = true)
public static void invokeRestAPI(){
String URL = 'http://pasquote-bfapp.tent.trt.ccc.pri/QuickQuoteWebSvc/QQWebSvc.asmx';
String xmlContent = '';
xmlContent = '<?xml version="1.0" encoding="utf-8"?>';
xmlContent = xmlContent + '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';
xmlContent = xmlContent + '<soap:Body>';
xmlContent = xmlContent + '<GetCityListFromZip xmlns="http://www.ccc.com/irv/quickquote/auto/2006/10/01">';
xmlContent = xmlContent + '<zipcode>92126</zipcode></GetCityListFromZip>';
xmlContent = xmlContent + '</GetCityListFromZip>';
xmlContent = xmlContent + ' </soap:Body>';
xmlContent = xmlContent + '</soap:Envelope>';
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setBody(xmlContent);
req.setHeader('content-type','text/xml');
req.setHeader('content-length', '0');
req.setEndpoint(URL);
req.setHeader('SoapAction', 'http://www.ccc.com//irv/quickquote/auto/2006/10/01/GetCityListFromZip');
req.setMethod('POST');
String response = '' ;
HttpResponse res = h.send(req);
response = res.getBody();
System.debug('Response :'+response);
}
}
Please guide.
Thank You
Shri
- Shri Raj
- August 12, 2014
- Like
- 1
- Continue reading or reply
How to query our Salesforce data from the front-end
We'd like to be able to query some of our Salesforce data from our front-end web app in order to get some information back for the current application user. Specifically we would like to query Salesforce based on a contact role email address in order to determine what Salesforce accoutn they are associated as well as retrieving information from related account opportunities.
Thanks, Paul
- Paul Howe
- June 06, 2014
- Like
- 0
- Continue reading or reply
Urgent !!--Outbound message Delivery Failure Reason - (503)Service Unavailable
Hi All,
I have provided the endpointurl as http://localhost:3590/OMSite/AccountNotificationService.asmx to send the outbound message from salesforce to my local webservice, but it's giving 503 service unavailable error.
Please help!!
- Narayan Panda
- February 12, 2013
- Like
- 0
- Continue reading or reply
Validate User Session Id in APEX Webservice
We have tight integration between Salesforce and a custom built .NET web appication. We have one security requirement where I need to call from Salesforce a web service that is hosted on our internal web application. As part of this call I need to pass the SessionId and UserId of the Salesforce user. The service will then need to make a call back to Salesforce to validate the session id is active for the specified user before it will perform the requested action. If the session id is not valid the service would simply return an error code.
I am open to any suggestions, but my first thought was to create an APEX class with a Webservice method that will allow an inbount call with the session id and user id and the service will return true or false depending if they are valid.
webService static Boolean validateSessionId(String strUserName, Id idSession)
However, I am not sure what code is necessary to be able to determine if the session id and user id are valid. Please let me know if anybody has thoughts on this.
I basically just need code to validate that a given session id and user id is currently active and valid.
Thanks for your help
- ITArchitect
- December 28, 2010
- Like
- 1
- Continue reading or reply
API returning 503 Service Unavailable, although the server never receives a request from Salesforce.
Unable to tunnel through proxy. Proxy returns "HTTP/1.0 503 Service Unavailable"
The API is actually not receiving any request on the server side, so they are unable to help. Thus asking if someone else has had a similar issue and a viable solution for the same.
- Pankaj Verma 12
- April 18, 2016
- Like
- 1
- Continue reading or reply
Get 503 service unavailable error when trying to connect to https://login.salesforce.com/services/Soap/c/13.0
Any idea what can issue?
Is it correct ebhaviour, is it fine if we use http over https, will SF support?
- Bhushan Laddad
- December 09, 2015
- Like
- 1
- Continue reading or reply
Apex Webservice Callout static IP
Is there any way to achieve this from apex. Can you suggest a workaround on how to achieve this? Any help will be appreciated.
- Ales Remta
- August 03, 2015
- Like
- 1
- Continue reading or reply
REST API Integration Issue. - System.HttpResponse[Status=Service Unavailable, StatusCode=503]
I will try to frame my question in short.
End Goal : REST API Integration from Salesforce to a InHouse Lead Management System(LMS2)
SUCCESS Through Chrome APP
1. All i need to do is retrieve values from LMS2. When i tried to use the Chrome APP 'Advanced Rest Client' and have passed the appropriate URL and Content in XML/TEST format in the form of POST methoed I was able to retrieve the values from LMS2 database.
For EG : If i pass 92126 then i was able to get 'SAN DIEGO' which is correct.
Here is the link (https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)for Advanced REST Client.
PROBLEM from Salesforce :
2) When i created this REST class in SAlesforce and tried invoking the End Point then its throwing this error.
System.HttpResponse[Status=Service Unavailable, StatusCode=503]
public with sharing class LmsRestApiIntegration {
//LmsRestApiIntegration.invokeRestAPI()
@future(callout = true)
public static void invokeRestAPI(){
String URL = 'http://pasquote-bfapp.tent.trt.ccc.pri/QuickQuoteWebSvc/QQWebSvc.asmx';
String xmlContent = '';
xmlContent = '<?xml version="1.0" encoding="utf-8"?>';
xmlContent = xmlContent + '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';
xmlContent = xmlContent + '<soap:Body>';
xmlContent = xmlContent + '<GetCityListFromZip xmlns="http://www.ccc.com/irv/quickquote/auto/2006/10/01">';
xmlContent = xmlContent + '<zipcode>92126</zipcode></GetCityListFromZip>';
xmlContent = xmlContent + '</GetCityListFromZip>';
xmlContent = xmlContent + ' </soap:Body>';
xmlContent = xmlContent + '</soap:Envelope>';
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setBody(xmlContent);
req.setHeader('content-type','text/xml');
req.setHeader('content-length', '0');
req.setEndpoint(URL);
req.setHeader('SoapAction', 'http://www.ccc.com//irv/quickquote/auto/2006/10/01/GetCityListFromZip');
req.setMethod('POST');
String response = '' ;
HttpResponse res = h.send(req);
response = res.getBody();
System.debug('Response :'+response);
}
}
Please guide.
Thank You
Shri
- Shri Raj
- August 12, 2014
- Like
- 1
- Continue reading or reply
Validate User Session Id in APEX Webservice
We have tight integration between Salesforce and a custom built .NET web appication. We have one security requirement where I need to call from Salesforce a web service that is hosted on our internal web application. As part of this call I need to pass the SessionId and UserId of the Salesforce user. The service will then need to make a call back to Salesforce to validate the session id is active for the specified user before it will perform the requested action. If the session id is not valid the service would simply return an error code.
I am open to any suggestions, but my first thought was to create an APEX class with a Webservice method that will allow an inbount call with the session id and user id and the service will return true or false depending if they are valid.
webService static Boolean validateSessionId(String strUserName, Id idSession)
However, I am not sure what code is necessary to be able to determine if the session id and user id are valid. Please let me know if anybody has thoughts on this.
I basically just need code to validate that a given session id and user id is currently active and valid.
Thanks for your help
- ITArchitect
- December 28, 2010
- Like
- 1
- Continue reading or reply