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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:09:07+00:00 2026-05-20T01:09:07+00:00

I’m not sure WCF being involved is significant or not. I have a class

  • 0

I’m not sure WCF being involved is significant or not.

I have a class and method exposed to a client asp.net app. The class looks like

<DataContract()> _
Public Class Class1
  Private v_string As String
  Private v_integer As Integer

  Public Sub New()
      v_string = ""
      v_integer = -1
  End Sub

  <DataMember()> _
  Public Property P_String() As String
    Get
        Return v_string
    End Get
    Set(ByVal value As String)
       v_string = value
    End Set
  End Property

  <DataMember()> _
  Public Property P_Integer() As Integer
    Get
        Return v_integer
    End Get
    Set(ByVal value As Integer)
       v_integer = value
    End Set
  End Property
End Class

The method is declared as

<OperationContract()> _
Function GetStuff(ByVal bar As Class1) As String

In the client code I create an instance of Class1 and set the values for v_string and v_integer, but using Wireshark to look at the xml being sent to the server only a value for v_string is being sent as part of Class1. I’m guessing this is because it considers the value of v_integer to be null/not set. Here is an example of the client code.

Dim MyService as New Service1.ServiceClient
Dim test as New Service1.Class1
test.P_integer = 1
test.P_string = "hello"
Dim result as String = MyService.GetStuff(test)

I’m guessing this is a problem with how different types are passed/used since Integer is a intergral type and String is a class, but can’t seem to work out what to do to fix the problem.

  • 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-20T01:09:08+00:00Added an answer on May 20, 2026 at 1:09 am

    A colleague of mine found that everthing works properly we change the decorations for the data members from:

    <DataMember()>_
    Public Property P_Integer() As Integer
    ...
    End Property
    

    To:

    <DataMember(IsRequired:=True)> _
    Public Property P_Integer() As Integer
    ...
    End Property
    

    for all value types. Class types such as string work fine without this.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.