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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T17:09:45+00:00 2026-05-14T17:09:45+00:00

I need to add a soap header to my web service. I plan to

  • 0

I need to add a soap header to my web service. I plan to use this to validate my clients (Windows Mobile Devices).

I found this link: http://www.c-sharpcorner.com/UploadFile/rog_21/soapheaders05172007120046PM/soapheaders.aspx

Which is exactly what I want to do. But it is not written for WCF.

I have done some research and I seem to be paralyzed by the number of options.

I basically want to add a simple header to my soap object that will be a user name and password. The client does not use WCF, so the soap header needs to just be a normal soap header.

Any Sample code or shoves in the right direction would be appreciated.

  • 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-14T17:09:46+00:00Added an answer on May 14, 2026 at 5:09 pm

    Rather than define a DataContract, use MessageContract

    [MessageContract]
    public class YourMessageType
    {
      // This is in the SOAP Header
      [MessageHeader] public string UserName {get;set;}
      [MessageHeader] public string Password {get;set;}
    
      // This is in the SOAP body
      [MessageBodyMember] public string OtherData {get;set;}
      ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to add to my message something like this: <soap:Header> <wsse:Security xmlns:wsse=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd soap:mustUnderstand=1>
I need to add this attribute ( xmlns:wsa=http://www.w3.org/2005/08/addressing ) to the soap header, like
Take the TripPriceService.wsdl from this link Add a service reference(ServiceReference1) to a windows application,
I created a Web Service use CXF with 1.2 soap binding. when i try
I need to add leading zeros to an array for mathematical use. Specifically, I
We need to add a service to our website, I've added the MVC extension
Scenario: Web-service producer have only SHA-1 hash of passwords stored in database. We need
I'm trying to call a webservice with Soap in PHP5, for this, I need
I need to create SOAP request like this: <soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/ xmlns:stor=http://storage.xdoc.xx/> <soapenv:Header/> <soapenv:Body> <stor:createDocument>
I wrote some WCF server that support SOAP. Now, i need to add some

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.