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

  • Home
  • SEARCH
  • 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 4043420
In Process

The Archive Base Latest Questions

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

I am building a streaming webservice in WCF and have an issue getting access

  • 0

I am building a streaming webservice in WCF and have an issue getting access to the underlying stream.

I am implementing an existing contract based on a wsdl but I would like to make the service streaming. Since I cannot change the contract, I cannot use the Stream as a parameter option (because this changes the contract).

So I have settled on using a Message as parameter and return. This works flawlessly.

But I would like to have access to the Stream object (which must be somewhere inside the Message object or its properties). But the only thing that the Message gives me is a XmlDictionaryReader and this does not allow access to the Stream.

public Message GetMessage(Message message)
    {
        // We need some way to access the underlying stream from the message - the GetReaderAtBodyContents is not usable
        XmlDictionaryReader reader = message.GetReaderAtBodyContents();
        CopyReaderToFile(reader);
        return Message.CreateMessage(MessageVersion.Soap11, "http://tempuri.org/IStreamingService/GetMessageResponse", "Hej med dig fra GetMessage. MessageLength ");
    }

The above shows my service implementation. The major problem with the XmlDictionaryReader is that it does not give me access to the precise data sent by the client – in other words I cannot reproduce the content from the client on the service. This is bad because I then cannot verify the signature which is present in the MessageHeaders.

So is there a way of accessing the underlying stream? Can this be achieved by behaviours?

Thanks in advance

  • 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-20T13:07:29+00:00Added an answer on May 20, 2026 at 1:07 pm

    The problem is that streaming is not provided by message itself but by underlaying message encoder. As you can see in two methods of abstract MessageEncoder class:

    • public abstract Message ReadMessage(Stream stream, int maxSizeOfHeaders, string contentType)
    • public abstract void WriteMessage(Message message, Stream stream)

    The stream is available only on channel level not in message. Another problem is that streaming cannot be combined with message security – so you can’t use any built-in signing etc.

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

Sidebar

Related Questions

building on my last question jQuery getting values from multiple selects together I have
Building an application to calculate metrics on Service Level Agreements. I have access to
I'm building a Qt based application to monitor and capture data streaming from a
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
I am building a training tool for a client. They require a secure streaming
I am building a radio streaming app and was wondering what would be a
I'm building a video streaming web site. I should receive video streams from several
So im building a chrome extension and I have placed an audio flash player
I'm building an Android app that will stream several radio stations from a Latin
I'm building a Flash mp3 player to handle streaming mp3s served by Amazon CloudFront

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.