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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:12:57+00:00 2026-06-09T15:12:57+00:00

I have a WCF service hosted over HTTP. The service has an opertation as

  • 0

I have a WCF service hosted over HTTP. The service has an opertation as the following:

[OperationContract]
MyResponse ProcessRequest(MyRequest request);

and the message contracts:

[MessageContract]
public class MyRequest
{
    [MessageBodyMember(Namespace = "http://company.com/schema/myobjectschema/2", Name = "RequestPayLoad")]
    public RequestPayLoadType RequestPayLoad{ get; set; }
} 

The RequestPayLoadType object is generated out of the schema file using xsd.exe and has all the appropriate namespaces.

Now when I invoke this service operation from SOAP UI, I’m finding that the soap UI request for ProcessRequest operation has all private fields in RequestPayLoadType present in the request. This is actually not accordance with the schema and the java client which is consuming this is breaking because of this.

For example my requestpayloadtype is structured as follows:

[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://company.com/schema/myobjectschema/2")]
[System.Xml.Serialization.XmlRootAttribute("EventHeader", Namespace = "http://company.com/schema/myobjectschema/2",
    IsNullable = false)]
public class RequestPayLoadType 
{
    private string messageIDField;
    public string MessageID
    {
        get
        {
            return this.messageIDField;
        }
        set
        {
            this.messageIDField = value;
        }
    }
}

When I send a request to the service the request is forming like this:

 <ns:TimeSeriesPayload>
       <messageIDField >?</messageIDField >
 </ns:TimeSeriesPayload>

My question is: why is the private field apperaing in the request. Why not the public properties. Is there an attribute which I set for preventing this from happening? My schema has deep level nesting so can I use an attrbute on the root level to prevent this from happening?

  • 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-09T15:12:58+00:00Added an answer on June 9, 2026 at 3:12 pm

    For WCF, you usually define your parameter objects as Data Contracts. Your RequestPayLoadType would be defined with the [DataContract] attribute and your public property MessageID would be defined with [DataMember] attribute. This could tip the serializer to use your public property.

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

Sidebar

Related Questions

I have a simple WCF service hosted in IIS7 using the HTTP protocol. The
I have a WCF service, hosted in IIS returning the following error (when trying
I have a simple WCF service hosted in IIS7.5 exposed over a wsHttp binding
I have a self-hosted WCF service and I'm having the following problem: 15 minutes
I have a wcf service that loads and the wsdl link works over http.
I have a Self-Hosted (Console App) WCF REST service with the following binding: WebMessageEncodingBindingElement
I have a WCF service being hosted over https with a self-signed certificate. I'm
I have created a WCF service which is hosted on a windows service over
I have a WCF service hosted in IIS6. It is doing simple WebRequest. When
I have a WCF service hosted in IIS and want to gain access to

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.