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

  • Home
  • SEARCH
  • 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 6988103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:01:43+00:00 2026-05-27T19:01:43+00:00

I am exposing Sql Server data through WCF to be consumed on a WP7

  • 0

I am exposing Sql Server data through WCF to be consumed on a WP7 application. Right now I have a choice, either I work with the data using the primary key or other columns for the same table.

I personally think it is best not to expose the PK, not that the phone is not secure, but because of the internet. But, please advice me.

thanks,

  • 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-05-27T19:01:44+00:00Added an answer on May 27, 2026 at 7:01 pm

    I assume that the PK you mentioned is of type int and it would not be secure to expose the values.

    In this case I’d add an alternate key of type GUID (uniqueidentifier in SQL Server). The field can be populated using the System.Guid.NewGuid() method from .Net code, or using the newid() function in SQL.

    That would make the key not predictable. For example, if a person sniffs your WCF traffic and sees a PK with a value of 4, they can try close values (2,3,5…) to access other records. GUIDs are not sequential, so it’s really hard to guess other key values.


    Please note that GUIDs take up 4x more storage space than an int (or 2x bigint), so if this will be a large table, the GUID approach could take considerably more space.

    In this case, you might reconsider if exposing keys is really a security problem; if the app is designed to be secure, or if all the records are meant to be viewed by anyone then exposing the PK value should not be so bad.

    After all, if you look at the URL of this page you will notice the value 8690786, which most probably is an exposed integer identifier of the question.

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

Sidebar

Related Questions

I have a Silverlight application that communications with an ASP.NET backend through WCF. I
Right now I'm exposing the service layer of my application using spring remoting's RMI/SOAP/JMS/Hessian/Burlap/HttpInvoker
I'm exposing some CRUD methods through WCF service, for some data objects persisted in
I have a class property exposing an internal IList<> through System.Collections.ObjectModel.ReadOnlyCollection<> How can I
I'm interested in one WCF server exposing both HTTP and TCP interfaces. It'll be
I have a users object that I'm exposing through the simple call: @users =
I have a repository class that wraps my LINQ to SQL Data Context. The
We are exposing a domain model via WCF Data Services. The model originates from
The application I am developing is exposing service metadata for a WCF service implementing
I have a WCF Service exposing a single contract and operation: <ServiceContract(Namespace:=ImageSystem)> _ Public

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.