• Rodolfo Noviski
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 6
    Replies
I'm trying to create a test class for my class call webservice. I'm using on a custom button, it is my knowledge that is not supported a standard class to perform the tests but even using Mock implementation is not able to hold someone could help me? For all I found so far was saying to create a fake response.

Thanks
Rodolfo Noviski
Hello,

I'm doing an integration with Google Drive, but when trying to read a spreadsheet is returning me the error message:

System.CalloutException: Exceeded max size limit of 3000000

Does anyone have any idea or has been there?
Can help me, please?

Thank you
Hello , I 'm trying to accomplish the following request:

    request.setHeader('Authorization', 'Bearer {Token}');
            String scope =  'https://www.googleapis.com/auth/drive,'+
                   'https://www.googleapis.com/auth/drive.file'+
                   'https://www.googleapis.com/auth/drive.appdata'+
                   'https://www.googleapis.com/auth/drive.apps.readonly'+
                   'https://www.googleapis.com/auth/drive.metadata.readonly'+
                   'https://www.googleapis.com/auth/drive.readonly'+
                   'https://www.googleapis.com/auth/drive.scripts';
       
       
        request.setHeader('Content-Type','application/json');
        request.setHeader('User-Agent','salesforce-toolkit-googledata/21');
        request.setHeader('Scope', scope);
        String body = '{\'value\':\'drive.permissions.insert\',\'type\':\'anyone\',\'role\':\'writer\'}';
        request.setBody(body);
        System.debug('Set Endpoint');
        request.setEndpoint(endpoint);
        System.debug('Set Method');
        request.setMethod('POST');

But I do not know how to automatically get the token that is sought. Could anyone help me?

thank you
Using the code below, following the tutorial available in the salesforce site.

        xmldom.element oneSpreadSheet = feedWk.entries[0]; // expects one spreadsheet 
        // get a new feed listing the worksheets in oneSpreadSheet
        GoogleData worksheetsFeed = service.getWorksheets( oneSpreadSheet );
               
        // pick the first one to rename
        GoogleData.Worksheet ws = new GoogleData.Worksheet( worksheetsFeed.entries[0] );
       
        string cellFeedUrl = ws.getCellFeedUrl();
      
        // specify range to avoid data overflow
       GoogleData feed = service.getFeed( cellFeedUrl );
       
  list<GoogleData.Cell> cells = ws.cellFactory( feed.entries );                 
  for (GoogleData.Cell cel : cells  )
        {
            cel.dump();
            system.debug ( cel.title + ' ' + cel.content ); 
            system.debug ( cel.id + ' ' +cel.row + ' ' + cel.col + ' ' + cel.edit );
  }

I'm not able to get a response when you run this code block. More specifically this line:
// specify range to avoid data overflow
       GoogleData feed = service.getFeed( cellFeedUrl );
      
  list<GoogleData.Cell> cells = ws.cellFactory( feed.entries );                
  for (GoogleData.Cell cel : cells  )
        {
            cel.dump();
            system.debug ( cel.title + ' ' + cel.content );
            system.debug ( cel.id + ' ' +cel.row + ' ' + cel.col + ' ' + cel.edit );
  }


No returns me no message in the log, not of error but returns no value, and the spreadsheet has values ​​to be returned

Has anyone had a similar experience? Could anyone help me?
thank you
By using the two links below to setup Google Spreadsheet API:

https://developer.salesforce.com/page/Google_Data_APIs_Toolkit_Setup

https://developer.salesforce.com/page/Google_Data_Authentication

during import of files as the tutorial, the same today are corrupted because of that is not being accepted by salesforce even download again the error persists. See the image below:

User-added image

And in case I try to create the object from the XML that this site it shows error in tag <webLinks>

can help me please ?
Thanks


I was reading this article: https://developer.salesforce.com/page/Google_Spreadsheets_API#Apex_Code_Examples
And when I was reading has the method: setAuthSubToken (sessionAuthToken)

The sessionAuthToken parameter as I can google? It was not clear how to perform the Auth so that it accesses my drive to read, write any files. I have access to the Google API console but what is my token? How can get access to this information?

Need to finish this task, someone could help me?

Thanks
Was trying to create a table using the Handsontable but not appearing on this visualforcepage. Has anyone managed to use this library? Or create a table using these methods? For me it does not return any error.

thank you
Rodolfo Noviski
By using the two links below to setup Google Spreadsheet API:

https://developer.salesforce.com/page/Google_Data_APIs_Toolkit_Setup

https://developer.salesforce.com/page/Google_Data_Authentication

during import of files as the tutorial, the same today are corrupted because of that is not being accepted by salesforce even download again the error persists. See the image below:

User-added image

And in case I try to create the object from the XML that this site it shows error in tag <webLinks>

can help me please ?
Thanks


I'm trying to create a test class for my class call webservice. I'm using on a custom button, it is my knowledge that is not supported a standard class to perform the tests but even using Mock implementation is not able to hold someone could help me? For all I found so far was saying to create a fake response.

Thanks
Rodolfo Noviski
Hello,

I'm doing an integration with Google Drive, but when trying to read a spreadsheet is returning me the error message:

System.CalloutException: Exceeded max size limit of 3000000

Does anyone have any idea or has been there?
Can help me, please?

Thank you
I was reading this article: https://developer.salesforce.com/page/Google_Spreadsheets_API#Apex_Code_Examples
And when I was reading has the method: setAuthSubToken (sessionAuthToken)

The sessionAuthToken parameter as I can google? It was not clear how to perform the Auth so that it accesses my drive to read, write any files. I have access to the Google API console but what is my token? How can get access to this information?

Need to finish this task, someone could help me?

Thanks
Was trying to create a table using the Handsontable but not appearing on this visualforcepage. Has anyone managed to use this library? Or create a table using these methods? For me it does not return any error.

thank you
Rodolfo Noviski

Hi,

 

I am trying to write test class for webservices class. I am getting error as 'Methods defined as TestMethod do not support Web service callouts, test skipped' . Please help me any one how to solve this.