Axis2 SOAP Envelope Header Information

I am using a web service that places an authentication token in the header of a SOAP envelope. It appears (looking at the samples that come with WS WSLL) that if a stub is generated in .NET, this header information is opened through a member variable in the stub class. However, when I create my Axis2 Java header using WSDL2Java, it does not appear anywhere.

What is the correct way to extract this information from the SOAP envelope header?

WSDL: http://www.vbar.com/zangelo/SecurityService.wsdl

C # example:


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; 
        }
    }
}

The sample illustrates what I would like to do. Note that the instance secSvchas a member variable SecurityHeaderValuethat populates after a successful call secSvc.SignIn().

API SignIn:

< > , SecurityHeaderValue . SecurityHeaderValue -.
+5
1

, , , :

MessageContext.getCurrentMessageContext().getEnvelope().getHeader()

+2

All Articles