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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:25:15+00:00 2026-05-17T02:25:15+00:00

Why is this so hard in WCF 4.0 I add a custom header in

  • 0

Why is this so hard in WCF 4.0

I add a custom header in my client

Authorization: 18732818 gfdsgShoyh3sfayql6jWCRc=

so that my header looks like the following

GET http://HOSTNAME/Public/Xml/SyncReply/TestClearUsername?Id=1 HTTP/1.1

Authorization: 18732818 gfdsgShoyh3sfayql6jWCRc=

Host: HOSTNAME

Connection: Keep-Alive

in my wired up service responder I can access the property Id and get the value 1. I would also like to access the value Authorization, but it always shows as null.

What am I doing wrong?

  • 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-17T02:25:15+00:00Added an answer on May 17, 2026 at 2:25 am

    After much googling I finally found the answer to this so I will post it here so it might be of use to someone else. I am assuming this is an undocumented feature, since it is so well hidden, but someone else might know different.

    I found this enumeration System.Web.HttpWorkerRequest.HeaderAuthorization (value=24)

    and this method System.Web.HttpWorkerRequest.GetKnownRequestHeader(24)

    Just to summarize the reason Authorization was hiding from me was that its a reserved header value. if you add a random word and want to retrieve you can use.

    .GetUnknownRequestHeader("YOUR_WORD_HERE").
    

    so in full you need

    HttpRequestContext hrc = (HttpRequestContext)this.RequestContext;
    
    RequestAttributes ra = (RequestAttributes)hrc.RequestAttributes;
    
    System.Web.HttpWorkerRequest hwr = ra.HttpWorkerRequest;
    
    string Auth = hwr.GetKnownRequestHeader(System.Web.HttpWorkerRequest.HeaderAuthorization);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Knowing so little about WCF, ASP.Net and Authentication/Authorization that I'm having a hard time
I have something like this hard-coded: private string[,] m_RolesForUser = new string[,] { {John,President,Chair},
Okay this is very hard to explain, but i want to add padding to
I try to create hard coded wcf service (no app.config) I tried the following
This should not be this hard. I simply need the following: SET @DueDate =
I am instantiating a PHP Soap Client like this: $client = new SoapClient('http://localhost:8731/MathService?wsdl',array( 'login'
EDIT2 Looks like I can't read properly, disregard this post, I will try to
I have a WCF service and a client that uses that service. They use
Mine is this: Hard coding is the way! All my problems go away. Just
This is hard for me to word, but easier for me to demonstrate: I

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.