title: Axis2 SOAP Envelope Header Information
body: <p>I'm consuming a web service that places an authentication token in the SOAP envelope header.  It appears (through looking at the samples that came with the WS WSDL) that if the stub is generated in .NET, this header information is exposed through a member variable in the stub class.  However, when I generate my Axis2 java stub using WSDL2Java it doesn't appear to be exposed anywhere. </p>
  
  <p>What is the correct way to extract this information from the SOAP envelope header? </p>
  
  <p><b>WSDL:</b>
  <a href="http://www.vbar.com/zangelo/SecurityService.wsdl" rel="noreferrer">http://www.vbar.com/zangelo/SecurityService.wsdl</a></p>
  
  <p><b>C# Sample:</b></p>
  
  <pre><code>
  using System;
  using SignInSample.Security;           // web service 
  using SignInSample.Document;           // web service
  
  namespace SignInSample
  {
      class SignInSampleClass
      {
          [STAThread]
          static void Main(string[] args)
          {
              // login to the Vault and set up the document service
              SecurityService secSvc = new SecurityService();
              secSvc.Url = "http://localhost/AutodeskDM/Services/SecurityService.asmx";
              secSvc.SecurityHeaderValue = new SignInSample.Security.SecurityHeader();
  
              secSvc.SignIn("Administrator", "", "Vault");
  
              DocumentServiceWse docSvc = new DocumentServiceWse();
              docSvc.Url = "http://localhost/AutodeskDM/Services/DocumentService.asmx";
              docSvc.SecurityHeaderValue = new SignInSample.Document.SecurityHeader();
              docSvc.SecurityHeaderValue.Ticket = secSvc.SecurityHeaderValue.Ticket;
              docSvc.SecurityHeaderValue.UserId = secSvc.SecurityHeaderValue.UserId; 
          }
      }
  }
  </code></pre>
  
  <p>The sample illustrates what I'd like to do.  Notice how the <code>secSvc</code> instance has a <code>SecurityHeaderValue</code> member variable that is populated after a successful <code>secSvc.SignIn()</code> invocation.</p>
  
  <p>Here's some relevant API documentation regarding the <code>SignIn</code> method: </p>
  
  <blockquote>
  <i>
  Although there is no return value, a successful sign in will populate the SecurityHeaderValue of the security service. The SecurityHeaderValue information is then used for other web service calls.</i>
  </blockquote>