Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8319185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:14:34+00:00 2026-06-08T22:14:34+00:00

Hi all i want to access azure tables entities from windows phone either using

  • 0

Hi all i want to access azure tables entities from windows phone either using rest API or using Odata.
I have written a code but that this giving me NULL response. Every time i want to access a table entity i call GetEntity function. Below is the code that i am using.
Please if anybody know what wrong in this code or any help reply asap.

//////////// GetEntity Function.//////////

     private void GetEntity(String tableName, String partitionKey, String rowKey)
    {
        String requestMethod = "GET";

        String urlPath = String.Format("{0}(PartitionKey='{1}',RowKey='{2}')", tableName,   partitionKey, rowKey);


        String dateInRfc1123Format = DateTime.Now.ToString("R", System.Globalization.CultureInfo.InvariantCulture);

        String canonicalizedResource = String.Format("/{0}/{1}", AzureStorageConstants.Account, urlPath);
        String stringToSign = String.Format(
              "{0}\n\n\n{1}\n{2}",
              requestMethod,
              dateInRfc1123Format,
              canonicalizedResource);
        String authorizationHeader = CreateAuthorizationHeader(stringToSign);
        HttpWebResponse response;
        Uri uri = new Uri(AzureStorageConstants.TableEndPoint + urlPath);


        HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
        request = (HttpWebRequest)WebRequest.Create(uri);
        request.Method = requestMethod;
        request.Headers[HttpRequestHeader.ProxyAuthorization] = null;
        request.Headers["Address"] = uri.ToString();
        request.Headers["Method"] = requestMethod;
        request.Headers["x-ms-date"]= DateTime.Now.ToString("R", System.Globalization.CultureInfo.InvariantCulture);
        request.Headers["x-ms-version"]= "2011-08-18";            
        request.Headers["Authorization"] = authorizationHeader;
        request.Headers["Accept-Charset"] = "UTF-8";
        request.Headers["ContentType"] = "application/atom+xml,application/xml";
        request.ContentType = "application/atom+xml,application/xml";
        request.Headers["DataServiceVersion"] = "1.0;NetFx";
        request.Headers["MaxDataServiceVersion"] = "1.0;NetFx";

       using (response = GetResponse(request))
        {
            Stream dataStream = response.GetResponseStream();
            using (StreamReader reader = new StreamReader(dataStream))
            {
                String responseFromServer = reader.ReadToEnd();
            }
        }
    }

// GetResponse Function.

       public HttpWebResponse GetResponse(HttpWebRequest request)
       {
        var dataReady = new AutoResetEvent(false);
        HttpWebResponse response = null;
        var callback = new AsyncCallback(delegate(IAsyncResult asynchronousResult)
        {
            response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);
            dataReady.Set();
        });

        request.BeginGetResponse(callback, request);
            return response;
    }

////// CreateAuthorization Function.///

      private String CreateAuthorizationHeader(String canonicalizedString)
    {
   String signature = string.Empty;
 using (HMACSHA256 hmacSha256 = new HMACSHA256(Convert.FromBase64String(AzureStorageConstants.Key))) 

 {
     Byte[] dataToHmac = System.Text.Encoding.UTF8.GetBytes(canonicalizedString);
     signature = Convert.ToBase64String(hmacSha256.ComputeHash(dataToHmac));
 }

String authorizationHeader = String.Format(
       CultureInfo.InvariantCulture,
       "{0} {1}:{2}",
       AzureStorageConstants.SharedKeyAuthorizationScheme,
       AzureStorageConstants.Account,
       signature);

return authorizationHeader;

}

////////AzureStorageConstants.

      public static class AzureStorageConstants
    {


     private static String TableAccount = "datablobs";
     private static String cloudEndPointFormat = "http://" + TableAccount + ".table.core.windows.net/";


    private static String cloudKey = "Primary Access Key";// Here actual key is written.
    private static string AzureStorage_SharedKeyAuthorizationScheme = "SharedKey";


        public static String Account
        {
            get { return TableAccount; }
        }

        public static string SharedKeyAuthorizationScheme
        {
            get { return AzureStorage_SharedKeyAuthorizationScheme; }
        }

        public static string Key
        {
            get { return  cloudKey; }
        }

        public static String TableEndPoint
        {
            get { return cloudEndPointFormat; }
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:14:35+00:00Added an answer on June 8, 2026 at 10:14 pm

    for solution refer to below linked i have posted the solution there http://social.msdn.microsoft.com/Forums/en-US/windowsazureconnectivity/thread/84415c36-9475-4af0-9f52-c534f5681432

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two Entities University courses Course students i want to access all the
I want to access all messages on a windows phone & take the back
i want to access a integer and a string from a class to all
HI all, Iam using VS2008 and SQL2008 i want to access my stored procedures
I have ArrayList>. In another activity I want to access all values stored in
All I want to do is access the <body> element from the code-behind of
I am developing a desktop application using pyside(qt), I want to access(iterate) all line
I have a Windows Azure application in which all read queries of TableA are
I now have my Windows Azure environment set up so that I can access
All i want to do is access my property from a parent Form in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.