[ 
https://issues.apache.org/jira/browse/AXIS2-4404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Glen Daniels updated AXIS2-4404:
--------------------------------

    Fix Version/s: 1.6

Targeting this for 1.6.

Also, reminder to Ramya - please update this with a stack trace, and ideally a 
minimal test case (if you can make one) that demonstrates the problem.

> MessageContext.getEnvelope() returning NoSuchElementException
> -------------------------------------------------------------
>
>                 Key: AXIS2-4404
>                 URL: https://issues.apache.org/jira/browse/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
>             Fix For: 1.6
>
>   Original Estimate: 0.02h
>  Remaining Estimate: 0.02h
>
> Hello,
> 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();
> MessageContext.getCurrentMessageContext().getEnvelope().serialize(System.out);
> System.out.println(envelope);
> 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);
>  outMessageContext.setEnvelope(createSOAPEnvelope());
>   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("http://www.w3.org/2001/XMLSchema-instance";, "xsi");
> envelope.declareNamespace(xsi);
> return envelope;
> }
> Your quick reply is highly appreciated as this is a Blocker and we are not 
> able to proceed further.
> Thanks!
> wsnewbie

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

Reply via email to