• Suresh_Softsquare
  • NEWBIE
  • 10 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 9
    Replies
I have implemented logic to invoke Force.com API's login method from apex (I am constructing the SOAP message through the code and post it as HTTP callout to the API endpoint). It used to work fine by sending username and password alone (without the security token). About a month ago we found that the login failed. We then added the Salesforce IPs in Network Access. The salesforce IPs are obtained from the wiki page below
https://help.salesforce.com/apex/HTViewSolution?urlname=Salesforce-IP-Address-to-whitelist&language=en_US

After this, the login worked. But starting from last week, we are again facing an issue. We are getting the "LOGIN_MUST_USE_SECURITY_TOKEN" exception from the API. After some research on this, I found that the source IP address of Salesforce in the HTTP request is different from the ones provided in the list. Has Salesforce added new IP ranges for their servers? Even after adding the IP, that I found, I am getting the same exception. Only when I include the Security token, the login succeeds. Anybody here facing the same issue? Any idea here would be greatky appreciated.

Thanks in advance
Suresh Kumar

We are developing a hybrid managed package that would allow the user to upload documents to a third-party document management system.
The other system exposes a RESTFul API that can be invoked from the end user's browser via AJAX. The proposed design is to use plain AJAX POST (based on XmlHttpRequest) for uploading documents through the API directly. Since the AJAX communication is completely between the  browser client and the third-party API, we are concerned that this design may not pass Application Security review. We need expert opinion on the feasibility of this approach. There are 2 alternate approaches:
a) Use an iFrame on the Upload Visualforce page that would allow the user to push the file directly to a Web page hosted on the third party system. With this approach, we would need to update file upload status on the Salesforce.com org using Force.com API from the other system.
b) Build a Visualforce page whose controller would invoke the third-party API as a callout. We will hit the heap size governor limit of 6 MB and callout payload size limit of 3 MB. This approach is very limiting and would not work for large files.

Hello,

 

We are in the process of building a managed package app to be placed in Appexchange. As per our current implementation, there is a integration piece which involves external system connecting to SFDC web service that we developed through Apex after a callout that we do from SFDC (like a two way integration). 

 

In order to connect to the web service, we need username & password+security_token of the org to authenticate to the web service. The problem is when we build this as a managed package that could be downloaded in any org, we need to get the credentials from the client who installs it in their org. We aren't sure whether requesting this in a package is acceptable. How do we handle this?

 

Anybody have idea on this? How does other composite apps in Appexchange handle the scenarios in which they need to access the SFDC web services API?

 

Thanks in advance,

Suresh.

I would like to write a query which searches based on a telephone number through SOAP API. In the clients SOQL DB the number could contain other string characters other than numbers such as:
(028)9067333
or
(028)-9067-333

My end query idealy would search for:
WHERE Phone = '0289067333' without any of the non-alphnumeric chars.

I would normally use a custom function or stored procedure, but this is not possible i think?? I also tried the REMOVE(originalstring,replacethis,withthis) function, however when I pass this as a query string through the SOAP api I receive an error saying "expecting a right parentheses at '-'. Has anyone any solutions to my problem?

Much appreciated
 
hi all,

I would like to know the procedure of how to register for develoepr  summer maintenance exam.
i logged in to my developer account and followed the path
Register for a new exam--->developer exam--->
however i am unable to proced further as i get a pop up saying that you have already passed this exam.But i have only passed the Spring exam and i now i want to give my summer release exam


Someone please help

 

Hi,

 

Is there any way to identify if the field is enabled for field history tracking using Apex?

 

DescribeFieldResult methods does not have any specific mention on the field history. If any of you can direct me towards something it would be very helpful for me.

 

Thanks,

Aravind

I'm using VF Remoting to create a Chatter Content Post.

 

When I run a similar operation to create a Chatter Text Post, the operation runs just fine.

 

No exception is being returned, and the error seems to be in JS (Firebug Output):

 

e is undefined
[Break On This Error] this);e.on("exception",this.onProvider...n(e){return this.transactions[e.tid||  

The operation is successfully completed in Apex and everything operates normally, and the response from the server is accurate and complete. However, due to this error, my callback function no longer operates, so I can't continue as normal.

 

Updated: I've logged this with the Partner Support portal. Here is some more source code to give you an idea:

 

global with sharing class Controller{	
@RemoteAction global static public chatterFeedPost PostChatterContent(String taskId, String commentText, String fileBody, String fileName){ chatterFeedPost returnPost = new chatterFeedPost(); FeedPost post = new FeedPost(); post.ParentId = taskId; post.Body = commentText; if(fileName != '' && fileBody != ''){ post.ContentData = EncodingUtil.base64decode(fileBody); post.ContentFileName = fileName; } returnPost.user = [SELECT Id,SmallPhotoUrl,Name FROM User WHERE Id = :UserInfo.getUserId()]; returnPost.feedpost = post; insert post; return returnPost; } global class chatterFeedPost { public FeedPost feedpost {get;set;} public User user {get;set;} public String errorMessage {get;set;} }
}

 And the Javascript:

 

<apex:Page controller="Controller">
<script type="text/javascript>
var result = Controller.PostChatterContent('string:chatter-object-target_id', 'string:chatterposttext', 'string:base64encodedcontent', 'string:filename',function(event, result){
					if (result.status) { //... do something ... }
</script>					
</page>

 


Hello,

 

We are in the process of building a managed package app to be placed in Appexchange. As per our current implementation, there is a integration piece which involves external system connecting to SFDC web service that we developed through Apex after a callout that we do from SFDC (like a two way integration). 

 

In order to connect to the web service, we need username & password+security_token of the org to authenticate to the web service. The problem is when we build this as a managed package that could be downloaded in any org, we need to get the credentials from the client who installs it in their org. We aren't sure whether requesting this in a package is acceptable. How do we handle this?

 

Anybody have idea on this? How does other composite apps in Appexchange handle the scenarios in which they need to access the SFDC web services API?

 

Thanks in advance,

Suresh.

Hi,

I wana to delivre (send) a PDF file to externe Web Service using HttpRequest 'POST' (with REST), and i dont know how i must proceed.

 

hat's wath i have do at now :

 

 

 String Id ='500S00000012tjM';
 
 PageReference pageRef = new PageReference('/apex/GenererPDF?id='+Id);
 
 Blob PDF = pageRef.getContentAsPDF(); 
 
        
 
 String endpointSend = 'https://WebServiceTEst';
 HttpRequest reqSend = new HttpRequest();
 reqSend.setEndpoint(endpointSend);
 reqSend.setMethod('POST');
 Blob headerValueSend = Blob.valueOf(usrName + ':' + psswd );
        String authorizationHeaderSend= 'Basic ' + EncodingUtil.base64Encode(headerValueSend);
        reqSend.setHeader('Authorization', authorizationHeader);
        
        reqSend.setHeader('content-type', 'application/pdf');
        
        //String BlodPDF = EncodingUtil.base64Encode(PDF);
        
        System.debug('22222222' + EncodingUtil.base64Encode(PDF));
        
        
        reqSend.setBody(EncodingUtil.base64Encode(PDF));
        
        
        Http httpLoadPDF = new Http();
       
       
       
        HTTPResponse responseLaodPDF = httpLoadPDF.send(reqSend);
        System.debug('STATUS:'+responseLaodPDF.getStatus());
        System.debug('STATUS_CODE:'+responseLaodPDF.getStatusCode());
        System.debug('333333' + responseLaodPDF.getBody());

 

Hi,

 

I was trying to do integration from Salesforce with other system. The way the Salesforce generates the SOAP message is as follows:

 

<?xml version="1.0" encoding="UTF-8"?>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<env:Header />

<env:Body>

<processRequest xmlns="java:credit.sfa.beans">

</processRequest>

</env:Body>

</env:Envelope>

 

Whereas the Other System that I'm integration is expecting SOAP message like as follows:

 

<?xml version="1.0" encoding="UTF-8"?>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<env:Header />

<env:Body>

<cdt:processRequest>

</cdt:processRequest>

</env:Body>

</env:Envelope>

 

And i'm getting SOAP Fault from the other System Saying (unexpected element processRequest).

I'm not sure whether i can control the SOAP message from Salesforce (to change the SOAP message dynamically) nor I should change the WSDL so that it works in both Salesforce and the other System.

 

Please suggest me.

 

Note: I'm using APEX callout (Synchronous).

 

 

 

  • August 06, 2010
  • Like
  • 0

I have some code that sends out an email. If I run that code from inside salesforce it works fine. However, if I run that code as the public sites user I get the following SendEmailResult error.

 

SendEmail failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []

 

However, all the mailing objects ID's (who, what, template and orgwide) are exactly the same when I send it from inside salesforce and from the website so I don't understand how it could be giving an error in one case but not the other.

 

 Here's the code that sends the email:

 

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 

mail.setTemplateId(template);

mail.setwhatId(what);

mail.setTargetObjectId(who);

mail.setSaveAsActivity(true);

mail.setOrgWideEmailAddressId(orgwide);

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail});

 

for(Messaging.SendEmailResult res : r){

if(res.isSuccess() == false)

System.debug(res.geterrors().get(0).getMessage());

}

 

 Am I misunderstanding the error or is there some other ID field that could be screwing up the email?

 

 

Message Edited by grigri9 on 11-17-2009 09:08 PM