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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:04:54+00:00 2026-06-12T14:04:54+00:00

I would like to allow some of my SOAP header elements to be nillable.

  • 0

I would like to allow some of my SOAP header elements to be nillable. This is possible for body elements, but I am not sure if it is allowed from header elements.

In the sample message below, I would like to allow the MessageDateTime to be null.

<definitions  xmlns="http://schemas.xmlsoap.org/wsdl/"
              xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
              xmlns:tns="http://mycompany.com/repositoryservice">
  <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
            attributeFormDefault="qualified"
            elementFormDefault="qualified"
            targetNamespace="http://mycompany.com/repositoryservice">
      <element name="MessageDateTime" type="dateTime" />
      <element name="SaveRequest">
        <!-- complexType -->
      </element>
    </schema>
  </types>
  <message name="SaveRequest_Headers">
    <part name="MessageDateTime" element="tns:MessageDateTime" />
  </message>
  <message name="SaveRequest">
    <part name="parameters" element="tns:SaveRequest" />
  </message>
  <binding name="RepositoryServiceBinding" type="tns:IRepositoryService">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="Save">
      <soap:operation soapAction="http://mycompany.com/repositoryservice/Save" style="document" />
      <input name="SaveRequest">
        <soap:header message="tns:SaveRequest_Headers" part="MessageDateTime" use="literal" />
        <soap:body use="literal" />
      </input>
    </operation>
  </binding>
  <!-- service, portType -->
</definitions>
  • 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-06-12T14:04:55+00:00Added an answer on June 12, 2026 at 2:04 pm

    It is allowed as long as the definition allows for it. In your case, all you have to do is add the nillable="true" to the element’s definition. The result on .NET w/ WCF would look something like this:

        [System.ServiceModel.MessageHeaderAttribute(Namespace="...")]
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public System.Nullable<System.DateTime> MessageDateTime;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to allow only one country access, but exclude proxies within this
I would like to allow some users to be able to launch a voip
I've got an ASPxGridView that I would like to allow some users to have
So I have been working on this for some time. Would like to know
I have some checkboxes and I would like to allow multiple selections, only that
I would like to allow some admins to manually enter SQL statements in a
I've a user profile and would like allow the user update everything about himself(username,
I've got a html-page with a picture on it and would like allow the
I would like to allow the user to click within my UserControl and drag
I would like to allow users to call my ruby on rails app as

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.