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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:08:52+00:00 2026-05-26T04:08:52+00:00

I have a very strange problem: The instance of my DTO that is non-null

  • 0

I have a very strange problem: The instance of my DTO that is non-null on the client side is received as null on the server side. Any ideas what could cause this? I don’t even know where I should start looking…


Some code (this is exactly the code I am executing):

Client side:

public class AuthenticatedUser
{
    private readonly UserDto _user;

    // ...

    public bool SetNewPassword(string oldPasswordHash, string newPasswordHash)
    {
        using (var userService = new UserServiceClient())
        {
            if(_user == null)
                throw new InvalidOperationException("Client side");
            return userService.SetNewPassword(_user, oldPasswordHash,
                                                     newPasswordHash);
        }
    }
}

The class UserDto has automatically been created when I added the service reference.

Server side:

public class UserService : IUserService
{
    // ...

    public bool SetNewPassword(UserDto userDto, string oldPasswordHash,
                                                string newPasswordHash)
    {
        using (var unitOfWork = _unitOfWorkFactory.Start())
        {
            if (userDto == null)
                throw new InvalidOperationException("Server side");

            var user = unitOfWork.Repository.Get<User>()
                                 .ByUserNameAndPasswordHash(userDto.UserName, 
                                                            oldPasswordHash);
            if (user == null)
                return false;
            user.PasswordHash = newPasswordHash;
            return true;
        }
    }
}

I am getting the InvalidOperationException with the text “Server side”…

UPDATE:
The UserDto class on the server side looks like this:

public class UserDto
{
    public UserDto() {}

    public UserDto(User domainObject)
    {
        Mapper.Map(domainObject, this);
    }

    public String AcademicDegree { get; set; }
    public String EmailAddress { get; set; }
    public String FirstName { get; set; }
    public Gender Gender { get; set; }
    public Boolean HasChangedPassword { get; set; }
    public Int32 Id { get; set; }
    public Boolean IsActive { get; set; }
    public String LastName { get; set; }
    public IEnumerable<MailboxDto> Mailboxes { get; set; }
    public String PasswordHash { get; set; }
    public String PronunciationOfName { get; set; }
    public String Role { get; set; }
    public IList<ScheduledGreetingDto> ScheduledGreetings { get; set; }
    public LanguageDto SpeakerLanguage { get; set; }
    public String Title { get; set; }
    public String UserName { get; set; }
}

Interestingly the _user field on the client side I try to transmit is an instance the client got from the server via a call to another service method, i.e. transmitting the UserDto seems to work in general…

  • 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-26T04:08:53+00:00Added an answer on May 26, 2026 at 4:08 am

    The most likely scenario is that the UserDto objects are not the same – namespace has changed, the properties do not match. If you’re using generated proxies, try Update Service Reference... to make sure client and server are in sync.

    You might want to use Fiddler to see what’s being sent between the two applications. This will let you check whether it’s a serialization issue (the client isn’t correctly sending the data) and a de-serialization issue (the server isn’t correctly receiving the data).

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

Sidebar

Related Questions

I experience a very strange problem and I don't have found any help to
Im having a very strange problem, i have a complicated view that returns incorrect
Very strange problem with my iPhone App. We have an App that has been
Very simple situation... very strange problem. I have a retained iVar NSMutableArray that I
We have very strange problem, one of our applications is continually querying server by
I have very strange problem while I am submitting a practice problem on codechef.
I have a very strange problem when I'm testing my application on device. I
I have a very strange problem. I have a working WCF service. [ServiceContract] public
I have a very strange problem with using geometry shaders. I made a very
I have a very strange problem in which identical pieces of Javascript are behaving

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.