axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramya (JIRA)" <>
Subject [jira] Created: (AXIS2-4404) MessageContext.getEnvelope() returning NoSuchElementException
Date Tue, 23 Jun 2009 23:13:07 GMT
MessageContext.getEnvelope() returning NoSuchElementException

                 Key: AXIS2-4404
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb, client-api, codegen, Tools, wsdl
    Affects Versions: 1.4.1
         Environment: Axis2 1.4.1, Tomcat5.5, JDK1.5, Eclipse 3.4.2
            Reporter: Ramya
            Priority: Blocker

I have a serious issue with getting hold of the incoming SOAP Envelope from MessageContext.
The reason I need the envelope is to be able to get the SOAP Header section, read data from
it, create a new header section for the response, populate it in the response Header along
with the Soap body data.
I am doing this in the Skeleton.
The following is the piece of code that throws a NoSuchElementException.
The wierd thing is that the error happens only on our test server (Windows 2003- SP2 machine
with jre1.5.0_13). On our dev server (Windows XP-SP3 running jdk1.5.0_06) here we dont get
this error.

SOAPEnvelope envelope = MessageContext.getCurrentMessageContext().getEnvelope();
SOAPHeader header = envelope.getHeader();
if (header != null)
 wfContextElem = header.getFirstChildWithName(BntService2007Stub.WFContext.MY_QNAME);
MessageContext inMsgContext = MessageContext.getCurrentMessageContext();
 OperationContext operationContext =   inMsgContext.getOperationContext();
 MessageContext outMessageContext = operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
  System.out.println("outenv in outcontext="+outMessageContext.getEnvelope());     			
response = ServiceDAO.getResponse(...);
 OMElement omElement = response.getOMElement(GetBankerNotesResponse.MY_QNAME,OMAbstractFactory.getOMFactory());
String omElementString = omElement.getBuilder().getDocumentElement().toStringWithConsume();
System.out.println("Response xml in skeleton="+omElementString);  

private SOAPEnvelope createSOAPEnvelope() {		
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();   
SOAPEnvelope envelope = fac.getDefaultEnvelope();
OMNamespace xsi = fac.createOMNamespace("", "xsi");
return envelope;

Your quick reply is highly appreciated as this is a Blocker and we are not able to proceed

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message