• raghav.M
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hi,

 

I have installed WAMP server on my laptop and deployed HTML5 application from Salesforce.com for Mobile workbook.

 

 

App location: 

C:\wamp\www\HTML5

 

Modified Login.js:

var clientId    = 'valid client key';

var redirectUri = 'http://localhost/HTML5/oauthcallback.html';

var proxyUrl    = 'http://localhost/HTML5/proxy.php?mode=native'; 

 

Problem:

========

After successful login I am not able to load the application. I am seeing spinning wheel "loading" .

 

Could someone help me. 

 

Thanks,

Rag

Hi,

 

I have executed the following code which makes a call to Amazon web services and I have receieved the following exception: 

 

<Response><Errors><Error><Code>InvalidParameterValue</Code><Message>Value (2011-8-30'T'6:53:6.495'Z') for parameter Timestamp is invalid. Must be in ISO8601 format.</Message></Error></Errors><RequestID>41aa0620-6f49-48cb-aead-bed311db49d1</RequestID></Response>

 

It will be great if someone helps to fix this problem and also posts AWS S3 REST sample code. 

 

Please replace 'AWS Secret Key' and 'AWS KEY' values before executing this code.

 

public with sharing class S3Rest {

public static void testAlexaWSForAmazon() {

       // The date format is yyyy-MM-dd'T'HH:mm:ss.SSS'Z' 

       DateTime d = System.now();

       String timestamp = ''+ d.year() + '-' +d.month() + '-' +d.day() + '\'T\'' +d.hour() + ':' +d.minute() + ':' +d.second() + '.' +d.millisecond() + '\'Z\'';

       String timeFormat = d.formatGmt(timestamp);

       String urlEncodedTimestamp = EncodingUtil.urlEncode(timestamp, 'UTF-8');

       String action = 'UrlInfo';

       String inputStr = action + timeFormat;

       String algorithmName = 'HMacSHA1';

       Blob mac = Crypto.generateMac(algorithmName, Blob.valueOf(inputStr),Blob.valueOf('AWS Secrect key'));

       String macUrl = EncodingUtil.urlEncode(EncodingUtil.base64Encode(mac), 'UTF-8');

       String urlToTest = 'amazon.com';

       String version = '2005-07-11';

       String endpoint = 'http://awis.amazonaws.com/';

       String accessKey = 'AWS KEY';

       HttpRequest req = new HttpRequest();

       req.setEndpoint(endpoint +'?AWSAccessKeyId=' + accessKey +'&Action=' +

                                 action +'&ResponseGroup=Rank&Version=' +

                                  version +'&Timestamp=' + urlEncodedTimestamp +

                                  '&Url=' + urlToTest +'&Signature=' + macUrl); 

        req.setMethod('GET');

        Http http = new Http();

       try {

             HttpResponse res =   http.send(req);

             System.debug('STATUS:'+res.getStatus());

             System.debug('STATUS_CODE:'+res.getStatusCode());

             System.debug('BODY: '+res.getBody());

        } catch(System.CalloutException e) {

              System.debug('ERROR: '+ e);

         }

   }

}

 

Thanks,

Rag

Hi,

 

I am using SOAPUI to test my webservices in Dev environment. I have received the following error:

 

faultcode>sf:INVALID_SESSION_ID</faultcode>         

<faultstring>INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session</faultstring>      </soapenv:Fault>   </soapenv:Body>

 

Questions:

1. How can I login to Salesforce from SOAPUI?

2. The Enterprise WSDL created by SFDC doesn't contain login method?

3. How to construct a SOAP request to login to Salesforce from SOAPUI.

 

 

Thanks,

Rag

 

Hi,

 

I have executed the following code which makes a call to Amazon web services and I have receieved the following exception: 

 

<Response><Errors><Error><Code>InvalidParameterValue</Code><Message>Value (2011-8-30'T'6:53:6.495'Z') for parameter Timestamp is invalid. Must be in ISO8601 format.</Message></Error></Errors><RequestID>41aa0620-6f49-48cb-aead-bed311db49d1</RequestID></Response>

 

It will be great if someone helps to fix this problem and also posts AWS S3 REST sample code. 

 

Please replace 'AWS Secret Key' and 'AWS KEY' values before executing this code.

 

public with sharing class S3Rest {

public static void testAlexaWSForAmazon() {

       // The date format is yyyy-MM-dd'T'HH:mm:ss.SSS'Z' 

       DateTime d = System.now();

       String timestamp = ''+ d.year() + '-' +d.month() + '-' +d.day() + '\'T\'' +d.hour() + ':' +d.minute() + ':' +d.second() + '.' +d.millisecond() + '\'Z\'';

       String timeFormat = d.formatGmt(timestamp);

       String urlEncodedTimestamp = EncodingUtil.urlEncode(timestamp, 'UTF-8');

       String action = 'UrlInfo';

       String inputStr = action + timeFormat;

       String algorithmName = 'HMacSHA1';

       Blob mac = Crypto.generateMac(algorithmName, Blob.valueOf(inputStr),Blob.valueOf('AWS Secrect key'));

       String macUrl = EncodingUtil.urlEncode(EncodingUtil.base64Encode(mac), 'UTF-8');

       String urlToTest = 'amazon.com';

       String version = '2005-07-11';

       String endpoint = 'http://awis.amazonaws.com/';

       String accessKey = 'AWS KEY';

       HttpRequest req = new HttpRequest();

       req.setEndpoint(endpoint +'?AWSAccessKeyId=' + accessKey +'&Action=' +

                                 action +'&ResponseGroup=Rank&Version=' +

                                  version +'&Timestamp=' + urlEncodedTimestamp +

                                  '&Url=' + urlToTest +'&Signature=' + macUrl); 

        req.setMethod('GET');

        Http http = new Http();

       try {

             HttpResponse res =   http.send(req);

             System.debug('STATUS:'+res.getStatus());

             System.debug('STATUS_CODE:'+res.getStatusCode());

             System.debug('BODY: '+res.getBody());

        } catch(System.CalloutException e) {

              System.debug('ERROR: '+ e);

         }

   }

}

 

Thanks,

Rag

Hi,

 

I am using SOAPUI to test my webservices in Dev environment. I have received the following error:

 

faultcode>sf:INVALID_SESSION_ID</faultcode>         

<faultstring>INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session</faultstring>      </soapenv:Fault>   </soapenv:Body>

 

Questions:

1. How can I login to Salesforce from SOAPUI?

2. The Enterprise WSDL created by SFDC doesn't contain login method?

3. How to construct a SOAP request to login to Salesforce from SOAPUI.

 

 

Thanks,

Rag