title: Can I remove the default namespace when creating raw Soap XML?
body: <p>I'm trying to send a soap request to a WCF service. I am building the soap request using the System.ServiceModel.Channels.Message.CreateMessage() method.</p>
  
  <p>I haven't gotten super deep into building the body, but here is what I have...</p>
  
  <pre><code>Message msg = Message.CreateMessage( MessageVersion.Soap11WSAddressing10, "MethodName" );
  msg.Headers.MessageId = new UniqueId( Guid.NewGuid().ToString() );
  msg.Headers.Add( Message.CreateHeader( "Security", "",
      new Security()
      {
          TimeStamp = new TimeStampType() {
              Created = DateTime.Now,
              Expires = Created.AddDays( 1 )
          },
          UsernameToken = new UsernameToken() {
              Username = "stackoverflow",
              Password = new Password() {
                  Type = "hashed",
                  Value = "Password"
              }
          }
       } ) ) );
  
  string s = msg.ToString();
  </code></pre>
  
  <p>When I run this, I get the following output. I'm using the Visual Studio XML Visualizer btw.</p>
  
  <pre><code>&lt;s:Envelope&gt;
      &lt;s:Header&gt;
          &lt;Action&gt;MethodName&lt;/Action&gt;
          &lt;MessageID&gt;GUIDVALUE&lt;/MessageID&gt;
          &lt;Security&gt;
              &lt;Timestamp xmlns="http://schemas.datacontract.org/2004/07/ConsoleApplication1"&gt;
                 .....
      &lt;/s:Header&gt;
      &lt;s:Body /&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  
  <p>My question is, can I remove xmlns="http://schemas.datacontract.org/2004/07/ConsoleApplication1" from the xml? It shows up in Timestamp and in UsernameToken.</p>
  
  <p>Thanks</p>