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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:43:54+00:00 2026-05-25T19:43:54+00:00

I have a problem of WCF definition of MessageContact and client calling function. Scenario;

  • 0

I have a problem of WCF definition of MessageContact and client calling function.

Scenario; Client called the service with a string type reference ID and server responds instance of type of AudioObject. AudioObject consists of Stream as MessageBodyMember and FormatObject as a MessageHeader.

Following is WCF code snippet.

[ServiceContract]
public interface IAudioStreamService
{
    [OperationContract]
    AudioObject GetAudioDataStream(StringMessage RefID);
}

//StringMessageContract
[MessageContract]
public class StringMessage
{
    [MessageBodyMember]
    public string Name;
}

[MessageContract]
public class AudioObject
{
    Stream _audioStream;
    AudioFormat _audioFormat;

    [MessageBodyMember (Order=1)]
    public Stream AudioStream
    {
        get { return _audioStream; }
        set { _audioStream = value; }
    }

    [MessageHeader(MustUnderstand=true)]
    public AudioFormat AudioFormat
    {
        get { return _audioFormat; }
        set { _audioFormat = value; }
    }
}

[DataContract]
public class AudioFormat
{
    int _nChannels;
    int _nKilloBitsPerSec;
    int _nSamplesPerSec;

    [DataMember(Name="nChannels", Order=0, IsRequired=true)]
    public int nChannels
    {
        get { return _nChannels; }
        set { _nChannels = value; }
    }
    [DataMember(Name = "nKilloBitsPerSec", Order = 1, IsRequired = true)]
    public int nKilloBitsPerSec
    {
        get { return _nKilloBitsPerSec; }
        set { _nKilloBitsPerSec = value; }
    }
    [DataMember(Name = "nSamplesPerSec", Order = 2, IsRequired = true)]
    public int nSamplesPerSec
    {
        get { return _nSamplesPerSec; }
        set { _nSamplesPerSec = value; }
    }
}

The client side code is as follows,

BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 176160768;                       
EndpointAddress endpointAddress = new EndpointAddress("URLToService");
AudioStreamServiceClient client = new AudioStreamServiceClient(binding, 
endpointAddress);
    AudioFormat audioFormat = client.GetAudioDataStream("000", out serverStream); 

The above code is worked fine. But the issue is,

In order to the format of the OperationContract, I expected the client code as follows,

AudioObject audioObject = client.GetAudioDataStream("0000");

But my ServiceReference generated the client-stub other way round(as shown in code). Can anybody explain me the reason for this matter.

  • 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-25T19:43:55+00:00Added an answer on May 25, 2026 at 7:43 pm

    Either write a client yourself by deriving a class from ClientBase or write an extension method with the method signature of your choice.

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

Sidebar

Related Questions

I have problem consuming a WCF REST service in my android application. The client
I have WCF Class library, WCF Service Client and WCF Service Server in one
I have a problem with WCF NetNamedPipeBinding. When I run my server and client
Now I have another problem with WCF server/client. I have a method: bool spr_wiersz(int
I have a problem with my WCF Data Service, and this one is just
I have a problem with getting jquery to retrieve results from a WCF service.
The problem: I have a WCF service that I'm trying to performance test with
Problem: I have a WCF service setup to be an endpoint for a call
Here is the problem: I have a WCF service and a few sites connecting
Greetings, I have to following problem. I have a WCF Service which runs under

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.