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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:39:47+00:00 2026-05-31T23:39:47+00:00

am trying to create WCF client to consume the service, which contains messages. So

  • 0

am trying to create WCF client to consume the service, which contains messages.
So far I am trying to communicate with by messages, that are made of an header (DateTime) and the body which is an object called User.
I have imported the app.config and the Proxy by using svcutil.
But, I get few errors.
Code:

    {
        RegistryServiceClient client = new RegistryServiceClient("WSHttpBinding_IRegistryService");
        UserMessage message = new UserMessage();


        message.time = DateTime.Now;

        message.user.id = "1";
        message.user.firstname = "John";
        message.user.lastname = "Smith";

        client.RegisterUser(message.time, message);
    }

Errors:
Error 2 Argument 1 must be passed with the ‘ref’ keyword
Error 3 Argument 2: cannot convert from ‘UserMessage’ to ‘ref http://www.domain.co.uk.User.user’
Error 1 The best overloaded method match for ‘RegistryServiceClient.RegisterUser(ref System.DateTime, ref http://www.domain.co.uk.User.user)’ has some invalid arguments

  • 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-31T23:39:47+00:00Added an answer on May 31, 2026 at 11:39 pm

    The RegisterUser method signature specifies a different type than your UserMessage, specifically a type called http://www.domain.co.uk.User.user. I don’t know the specifics of the UserMessage class, but I’m going to go out on a limb and guess that the user property is of type http://www.domain.co.uk.User.user. So try:

    client.RegisterUser(ref message.time, ref message.user)
    

    and see what happens.

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

Sidebar

Related Questions

I'm trying to create a client for a WCF service that I have hosted
I'm trying to create a web service client using CXF to consume a WCF
I'm trying to create a WCF client to send XML messages to a CGI
Trying to create an framework 4.0 WCF basicHttp service hosted by IIS (6) that
I am trying to create a WCF service that uses certificate authentication over SSL
I am trying to create a WCF service that supports asynchronous calls. I followed
I am trying to create a WCF client that operates with an http rest
I am trying to create a WCF service that will use message mode security
I'm am trying to create a very simple WCF client application which will send
I am trying to create a WCF service that is accessible through both webHttpBinding

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.