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 7926769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:55:38+00:00 2026-06-03T18:55:38+00:00

While creating a WCF Rest service, I’ve noticed that not all the parameters in

  • 0

While creating a WCF Rest service, I’ve noticed that not all the parameters in my web service are making it into my implementation.

Here’s the interface:

[ServiceContract(Namespace="http://example.com/recordservice")]
public interface IBosleySchedulingServiceImpl
{
    [OperationContract]
    [WebInvoke(UriTemplate = "Record/Create",
        RequestFormat = WebMessageFormat.Xml, 
        ResponseFormat = WebMessageFormat.Xml,
        BodyStyle = WebMessageBodyStyle.Bare, Method = "POST")]
    string CreateRecord(Record record);
}

[DataContract(Namespace="http://example.com/recordservice")]
public class Appointment
{
    [DataMember]
    public int ResponseType { get; set; }

    [DataMember]
    public int ServiceType { get; set; }

    [DataMember]
    public string ContactId { get; set; }

    [DataMember]
    public string Location { get; set; }

    [DataMember]
    public string Time { get; set; }        
}

I’m passing this XML in:

<Appointment xmlns="http://ngs.bosley.com/BosleySchedulingService">
  <ContactId>1123-123</ContactId>
  <Location>Fresno</Location>
  <Time>2012-05-05T08:30:00</Time>
  <ResponseType>45</ResponseType>
  <ServiceType>45</ServiceType>
</Appointment>

In my service, I’m just outputting the values to a log so I can verify the values are coming through for the time being:

logger.Debug("ContactId: " + appointment.ContactId);
logger.Debug("Time Field: " + appointment.Time);
logger.Debug("Location: " + appointment.Location);
logger.Debug("Response Type: " + Convert.ToInt32(appointment.ResponseType));
logger.Debug("ServiceType: " + Convert.ToInt32(appointment.ServiceType));

However, in my output, the integer values are coming across as zeroes:

ContactId: 1123-123
Time Field: 2012-05-05T08:30:00
Location: Fresno
Response Type: 0
ServiceType: 0

When I remove the strings from the DataContract and the service implementation, the integer values come through without a problem.

Response Type: 45
ServiceType: 45

I am utterly confused by this and any help would be greatly appreciated.

  • 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-03T18:55:42+00:00Added an answer on June 3, 2026 at 6:55 pm

    By default when you send an object through wcf the properties will be sent in Alphabetical order unless you specify the order.

    You can specify the order of the properties or change the ordering so that they appear in alphabetical order.

    [DataContract(Namespace="http://example.com/recordservice")]
    public class Appointment
    {
        [DataMember(Order = 1)]
        public int ResponseType { get; set; }
    
        [DataMember(Order = 2)]
        public int ServiceType { get; set; }
    
        [DataMember(Order = 3)]
        public string ContactId { get; set; }
    
        [DataMember(Order = 4)]
        public string Location { get; set; }
    
        [DataMember(Order = 5)]
        public string Time { get; set; }        
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just noticed while creating a RESTful WCF service that the Method parameter on
This relates somewhat to: InvalidOperationException while creating wcf web service instance I have a
While creating JavaScript with ASP.NET MVC I noticed several scope warnings and realized that
I have run into an issue while creating a data service and using Autofac
The WCF service while hosting with IIS is failing. The web.config for the service
I'm putting together a WCF service that handles a large search (currently 50-60 parameters,
I created a simple WCF web service that has one method: SubmitTicket(flightticket ft, string
I am creating WCF service that will download & upload xml files. When trying
I've had not a lot of luck creating a WCF service with Visual Studio.
While creating a simple client for a REST service which I have stubbed out,

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.