• kkk
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies

Hi,

 

I've been searching around the possibility in Salesforce to use self-sign certificate from a webserver, to make a https web request call.

My scenario was, Salesforce send a request to connect with server X, authenticated with username, password and self-sign certificate from server X.

With a HttpRequest class, set the endpoint url and set the username and password in Authorization Header, I've got an error message 

System.CalloutException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

The Web server, I need to connect to, has a self-signed certificate which should be included in the call-outs for the Authentification. Since I didn't see any possibility for me to upload the self-sign certificate from a third party and set it up in the HttpRequest class.

 

 

How can I solve this problem?

 

I red an article that in Java we can set the request manually to ignored self-signed certificates request, but I don't know if it is possible to implement in Apex Code.

 

Thanks!

 

 

  • September 24, 2012
  • Like
  • 0

Hi all,

 

I need help on how to write a http request with servlet.

Here is the situation:

I have to call this url:

     http://x.x.x.x/dev_back/CustomerServlet?action=0&user=john

From the url, I will get all customer data in JSON Object, which I have to parse later and save it into Customer object in Salesforce.

 

Since I'm new in backend programming and webservices call, could anyone help me on how to get the response from those url in apex code?

Here is the code that I have until now (sorry, if I'm maybe completely wrong on this):

 

String url = 'http://x.x.x.x/dev_back/CustomerServlet?action=0&user=john';

Http h = new Http();

// Instantiate a new HTTP request, specify the method (GET) as well as the endpoint 
HttpRequest req = new HttpRequest();
req.setEndpoint(url);
req.setMethod('GET');

// Send the request, and return a response 
    
HttpResponse res = h.send(req);

 But with the code above, I'm not be able to get the response. When I take a look on res.getBody() message, I saw that the url is being cut off, it takes only "http://x.x.x.x/dev_back/CustomerServlet?" as the string url.

 

How can I solve this?

 

Thanks!

  • September 04, 2012
  • Like
  • 0

Hi everyone,

 

How can I submit for an approval for multiple records? I know that in SFDC org, we can only submit for approval with one records through the submit approval button.


Using apex class, I see that when we create an Approval.ProcessSubmitRequest, we can set the record Id in setObjectId. I didn't see any option that I can put multiple record on this class.

 

Can someone help me out for this? Maybe with overriding the class method from Approval class?

It would be great if you could also provide me with some code for overriding.

 

Thank you..

 

Jay

  • July 30, 2012
  • Like
  • 0

Hi everyone,

 

How can I submit for an approval for multiple records? I know that in SFDC org, we can only submit for approval with one records through the submit approval button.


Using apex class, I see that when we create an Approval.ProcessSubmitRequest, we can set the record Id in setObjectId. I didn't see any option that I can put multiple record on this class.

 

Can someone help me out for this? Maybe with overriding the class method from Approval class?

It would be great if you could also provide me with some code for overriding.

 

Thank you..

 

Jay

  • July 30, 2012
  • Like
  • 0