[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sandesha-dev
Subject:    Re: facing problem while logging the soap messages
From:       Andreas Veithen <andreas.veithen () gmail ! com>
Date:       2015-08-18 13:12:59
Message-ID: CADx4_uVBHe3QG26wwktXnR8rxm+XcBNTsM7wf1xT8srW78EE4A () mail ! gmail ! com
[Download RAW message or body]

If you are willing to test this with 1.6.4-SNAPSHOT and confirm that the
issue still exists, then I will investigate and try to get a fix into 1.6.4.

Andreas

On Tue, Aug 18, 2015 at 1:12 PM, satyapriya sahoo <
sahoo.satyapriya@gmail.com> wrote:

> Thanks for your message Andreas. Same exception I am facing for
> AXIS2-1.6.2 also. For that reason I moove back to Axis2-1.5.1 and this time
> also I don't get any luck.
> 
> Thanks,
> Satya
> 
> On Tue, Aug 18, 2015 at 4:02 PM, Andreas Veithen <
> andreas.veithen@gmail.com> wrote:
> 
> > Axis2 1.5.1 is old and no longer supported. To get help with this issue,
> > you will likely need to upgrade to 1.6.x.
> > 
> > Andreas
> > 
> > 
> > On Tue, Aug 18, 2015 at 9:22 AM, satyapriya sahoo <
> > sahoo.satyapriya@gmail.com> wrote:
> > 
> > > Hi,
> > > 
> > > I am using Axis2-1.5.1 with JDK1.6.
> > > 
> > > I have written 1 module to write the SOAP Messages. Here I am acting as
> > > a *server*.
> > > When it is trying to write the SOAP ENVELOPE IN Message, it is throwing
> > > the Bellow Exception
> > > 
> > > 18 Aug 2015 13:03:41,956 - ERROR invoke (TestHandler.java:66) -
> > > Exception Occured while logging the message
> > > *org.apache.axiom.om.OMException: Parser has already reached end of the
> > > document. No siblings found*
> > > at
> > > org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:339)
> > >  at
> > > org.apache.axiom.om.impl.traverse.OMChildrenIterator.next(OMChildrenIterator.java:102)
> > >  at
> > > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:953)
> > >  at
> > > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)
> > >  at
> > > org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:227)
> > >  at
> > > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)
> > >  at
> > > org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:387)
> > > at
> > > org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1106)
> > > at
> > > com.synchronoss.webservice.itsm.logger.TestHandler.invoke(TestHandler.java:34)
> > > at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
> > > at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251)
> > > at org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:508)
> > > at
> > > org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:423)
> > > at
> > > org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:386)
> > >  at
> > > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:176)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> > > at
> > > weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
> > >  at
> > > weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
> > >  at
> > > weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
> > > at
> > > weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
> > > at
> > > weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
> > >  at
> > > weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
> > >  at
> > > weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
> > >  at
> > > weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
> > > at
> > > weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
> > >  at
> > > weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
> > >  at
> > > weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
> > > at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
> > > at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
> > > 
> > > 
> > > STEPS I followed :
> > > 
> > > *Created 1 TestModule.java*
> > > 
> > > package com.test.logger;
> > > 
> > > import org.apache.axis2.AxisFault;
> > > import org.apache.axis2.context.ConfigurationContext;
> > > import org.apache.axis2.description.AxisDescription;
> > > import org.apache.axis2.description.AxisModule;
> > > import org.apache.axis2.modules.Module;
> > > import org.apache.neethi.Assertion;
> > > import org.apache.neethi.Policy;
> > > 
> > > public class TestModule implements Module{
> > > 
> > > @Override
> > > public void applyPolicy(Policy arg0, AxisDescription arg1) throws
> > > AxisFault {
> > > // TODO Auto-generated method stub
> > > }
> > > 
> > > @Override
> > > public boolean canSupportAssertion(Assertion arg0) {
> > > // TODO Auto-generated method stub
> > > return false;
> > > }
> > > 
> > > @Override
> > > public void engageNotify(AxisDescription arg0) throws AxisFault {
> > > // TODO Auto-generated method stub
> > > }
> > > 
> > > @Override
> > > public void init(ConfigurationContext arg0, AxisModule arg1)
> > > throws AxisFault {
> > > // TODO Auto-generated method stub
> > > }
> > > 
> > > @Override
> > > public void shutdown(ConfigurationContext arg0) throws AxisFault {
> > > // TODO Auto-generated method stub
> > > }
> > > 
> > > }
> > > 
> > > *2) Created 1 Handler class*
> > > package com.test.logger;
> > > 
> > > import org.apache.axis2.AxisFault;
> > > import org.apache.axis2.context.MessageContext;
> > > import org.apache.axis2.context.OperationContext;
> > > import org.apache.axis2.engine.Handler;
> > > import org.apache.axis2.handlers.AbstractHandler;
> > > import org.apache.axis2.wsdl.WSDLConstants;
> > > import org.apache.commons.logging.Log;
> > > import org.apache.commons.logging.LogFactory;
> > > 
> > > public class TestHandler extends AbstractHandler implements Handler{
> > > 
> > > private static Log log = LogFactory.getLog(TestHandler.class);
> > > 
> > > private String name;
> > > 
> > > public String getName() {
> > > return name;
> > > }
> > > 
> > > public void setName(String name) {
> > > log.debug("Setting name as :"+name);
> > > this.name = name;
> > > }
> > > 
> > > public InvocationResponse invoke(MessageContext msgContext) throws
> > > AxisFault {
> > > try{
> > > log.debug("Received Request.");
> > > StringBuilder stringBuilder=new StringBuilder();
> > > OperationContext operationContext = msgContext.getOperationContext();
> > > if(operationContext!=null){
> > > MessageContext inMessage =
> > > operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
> > > *String inSoapRequest = inMessage.getEnvelope().toString();
> > > <-------------------------------------------------------------------------------------Facing
> > >  Problem here*
> > > 
> > > MessageContext outMessage =
> > > operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
> > > MessageContext faultMessage =
> > > operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_FAULT_VALUE);
> > > 
> > > if(outMessage==null&&faultMessage==null){
> > > log.debug("\n--------------Request Received(NEW
> > > LOGGER)--------------\n"+inSoapRequest);
> > > }
> > > if(outMessage!=null || faultMessage!=null){
> > > stringBuilder.append("\n-------IN MESSAGE(NEW LOGGER)-------\n");
> > > 
> > > stringBuilder.append(inSoapRequest);
> > > stringBuilder.append("\n-------OUT MESSAGE(NEW LOGGER)-------\n");
> > > 
> > > if(outMessage!=null){
> > > 
> > > String outMessageEnvelope = outMessage.getEnvelope().toString();
> > > stringBuilder.append(outMessageEnvelope);
> > > }
> > > 
> > > if(faultMessage!=null){
> > > stringBuilder.append("\n-------FAULT MESSAGE(NEW LOGGER)-------\n");
> > > String faultMessagerEnvelope = faultMessage.getEnvelope().toString();
> > > stringBuilder.append(faultMessagerEnvelope);
> > > //                                   stringBuilder.append("\n Fault
> > > Envelope : "+faultMessagerEnvelope+"\n");
> > > //                                   stringBuilder.append("\n Fault
> > > Reason : "+faultMessage.getFailureReason().getMessage()+"\n");
> > > //
> > > faultMessage.getFailureReason().printStackTrace();
> > > }
> > > 
> > > log.debug("\nTRANSACTION START (NEW LOGGER):"+stringBuilder.toString()+
> > > "\nTRANSACTION END\n");
> > > }
> > > 
> > > }
> > > }catch(Exception e){
> > > log.error("Exception Occured while logging the message ",e);
> > > }
> > > return InvocationResponse.CONTINUE;
> > > }
> > > 
> > > public void revoke(MessageContext msgContext) {
> > > log.debug("Revoking Started");
> > > log.info(msgContext.getEnvelope().toString());
> > > log.debug("Revoking completed");
> > > }
> > > 
> > > }
> > > 
> > > 3) U*nder META-INF folder, I put the module.xml*
> > > 
> > > <module name="TestModule" class="com.test.logger.TestModule">
> > > <InFlow>
> > > <handler name="InFlowLogHandler"
> > > class="com.test.logger.TestHandler">
> > > <order phase="TestPhase" />
> > > </handler>
> > > </InFlow>
> > > 
> > > <OutFlow>
> > > <handler name="OutFlowLogHandler"
> > > class="com.test.logger.TestHandler">
> > > <order phase="TestPhase"/>
> > > </handler>
> > > </OutFlow>
> > > 
> > > <OutFaultFlow>
> > > <handler name="FaultOutFlowLogHandler"
> > > class="com.test.logger.TestHandler">
> > > <order phase="TestPhase"/>
> > > </handler>
> > > </OutFaultFlow>
> > > 
> > > <InFaultFlow>
> > > <handler name="FaultInFlowLogHandler"
> > > class="com.test.loggerTestHandler">
> > > <order phase="TestPhase"/>
> > > </handler>
> > > </InFaultFlow>
> > > </module>
> > > 
> > > *4) Then I created the .mar file and put it under AXIS2/WEB-INF/modules*
> > > 
> > > *5) After that I modify the axis2.xml*
> > > 
> > > <!-- Global Modules  -->
> > > <!-- ================================================= -->
> > > <!-- Comment this to disable Addressing -->
> > > <module ref="addressing"/>
> > > *   <module ref="TestModule"/>*
> > > 
> > > <phaseOrder type="InFlow">
> > > <!--  System predefined phases       -->
> > > <phase name="Transport">
> > > <handler name="RequestURIBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
> > > <order phase="Transport"/>
> > > </handler>
> > > <handler name="SOAPActionBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
> > > <order phase="Transport"/>
> > > </handler>
> > > </phase>
> > > <phase name="Addressing">
> > > <handler name="AddressingBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
> > > <order phase="Addressing"/>
> > > </handler>
> > > </phase>
> > > *  <phase name="TestPhase"/>*
> > > <phase name="Security"/>
> > > <phase name="PreDispatch"/>
> > > <phase name="Dispatch"
> > > class="org.apache.axis2.engine.DispatchPhase">
> > > <handler name="RequestURIBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
> > > <handler name="SOAPActionBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
> > > <handler name="RequestURIOperationDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
> > > <handler name="SOAPMessageBodyBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
> > > <handler name="HTTPLocationBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
> > > <handler name="GenericProviderDispatcher"
> > > 
> > > class="org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher"/>
> > > <handler name="MustUnderstandValidationDispatcher"
> > > 
> > > class="org.apache.axis2.jaxws.dispatchers.MustUnderstandValidationDispatcher"/>
> > > </phase>
> > > <phase name="RMPhase"/>
> > > <!--  System predefined phases       -->
> > > <!--   After Postdispatch phase module author or service author
> > > can add any phase he want      -->
> > > <phase name="OperationInPhase">
> > > <handler name="MustUnderstandChecker"
> > > 
> > > class="org.apache.axis2.jaxws.dispatchers.MustUnderstandChecker">
> > > <order phase="OperationInPhase"/>
> > > </handler>
> > > </phase>
> > > <phase name="soapmonitorPhase"/>
> > > </phaseOrder>
> > > <phaseOrder type="OutFlow">
> > > <!--      user can add his own phases to this area  -->
> > > <phase name="soapmonitorPhase"/>
> > > <phase name="OperationOutPhase"/>
> > > <!--system predefined phase-->
> > > <!--these phase will run irrespective of the service-->
> > > <phase name="RMPhase"/>
> > > <phase name="PolicyDetermination"/>
> > > <phase name="MessageOut">
> > > </phase>
> > > <phase name="Security"/>
> > > *<phase name="TestPhase"/>*
> > > </phaseOrder>
> > > <phaseOrder type="InFaultFlow">
> > > <phase name="Addressing">
> > > <handler name="AddressingBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
> > > <order phase="Addressing"/>
> > > </handler>
> > > </phase>
> > > <phase name="Security"/>
> > > *        <phase name="TestPhase"/>*
> > > <phase name="PreDispatch"/>
> > > <phase name="Dispatch"
> > > class="org.apache.axis2.engine.DispatchPhase">
> > > <handler name="RequestURIBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
> > > <handler name="SOAPActionBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
> > > <handler name="RequestURIOperationDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
> > > <handler name="SOAPMessageBodyBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
> > > <handler name="HTTPLocationBasedDispatcher"
> > > 
> > > class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
> > > <handler name="GenericProviderDispatcher"
> > > 
> > > class="org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher"/>
> > > <handler name="MustUnderstandValidationDispatcher"
> > > 
> > > class="org.apache.axis2.jaxws.dispatchers.MustUnderstandValidationDispatcher"/>
> > > </phase>
> > > <phase name="RMPhase"/>
> > > <!--      user can add his own phases to this area  -->
> > > <phase name="OperationInFaultPhase"/>
> > > <phase name="soapmonitorPhase"/>
> > > 
> > > </phaseOrder>
> > > <phaseOrder type="OutFaultFlow">
> > > <!--      user can add his own phases to this area  -->
> > > <phase name="soapmonitorPhase"/>
> > > <phase name="OperationOutFaultPhase"/>
> > > <phase name="RMPhase"/>
> > > <phase name="PolicyDetermination"/>
> > > <phase name="MessageOut">
> > > </phase>
> > > <phase name="Security"/>
> > > *  <phase name="TestPhase"/>*
> > > </phaseOrder>
> > > 
> > > No Idea why I am getting the Exception. Again In my Server code when I
> > > am trying to access The SOAPEnvelope , it is giving the the bellow exception
> > > 
> > > *MessageContext messageContext =
> > > MessageContext.getCurrentMessageContext();*
> > > *SOAPEnvelope soapEnvelope = messageContext.getEnvelope();*
> > > 
> > > when I am trying to print or access the *soapEnvelope*, it is throwing
> > > the bellow exception
> > > *com.sun.jdi.InvocationException occurred invoking method.*
> > > 
> > > 
> > > 
> > > The SOAP XML I am sending to server is like bellow Format,
> > > 
> > > <SOAP-ENV:Envelope xmlns:SOAP-ENV="
> > > http://schemas.xmlsoap.org/soap/envelope/">
> > > <SOAP-ENV:Header>
> > > <AuthenticationInfo>
> > > <userName>ABC</userName>
> > > <password>ABC</password>
> > > </AuthenticationInfo>
> > > </SOAP-ENV:Header>
> > > <SOAP-ENV:Body>
> > > <EMP>
> > > <NAME>SATYA</NAME>
> > > <ROLLNO>1</ROLLNO>
> > > </EMP>
> > > </SOAP-ENV:Body>
> > > </SOAP-ENV:Envelope>
> > > 
> > > Please help me and suggest me how to solve this problem. If I did
> > > anything wrong please let me know. Your suggestions are valuable to me.
> > > 
> > > Thanks,
> > > Satya
> > > 
> > 
> > 
> 


[Attachment #3 (text/html)]

<div dir="ltr">If you are willing to test this with 1.6.4-SNAPSHOT and confirm that \
the issue still exists, then I will investigate and try to get a fix into \
1.6.4.<div><br></div><div>Andreas<br><div class="gmail_extra"><br><div \
class="gmail_quote">On Tue, Aug 18, 2015 at 1:12 PM, satyapriya sahoo <span \
dir="ltr">&lt;<a href="mailto:sahoo.satyapriya@gmail.com" \
target="_blank">sahoo.satyapriya@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Thanks for your message Andreas. Same \
exception I am facing for AXIS2-1.6.2 also. For that reason I moove back to \
Axis2-1.5.1 and this time also I don&#39;t get any \
luck.<div><br></div><div>Thanks,</div><div>Satya</div></div><div class="HOEnZb"><div \
class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 18, 2015 \
at 4:02 PM, Andreas Veithen <span dir="ltr">&lt;<a \
href="mailto:andreas.veithen@gmail.com" \
target="_blank">andreas.veithen@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Axis2 1.5.1 is old and no longer supported. To \
get help with this issue, you will likely need to upgrade to 1.6.x.<span><font \
color="#888888"><div><br></div></font></span><div><span><font \
color="#888888">Andreas</font></span><div><div><br><div class="gmail_extra"><br><div \
class="gmail_quote">On Tue, Aug 18, 2015 at 9:22 AM, satyapriya sahoo <span \
dir="ltr">&lt;<a href="mailto:sahoo.satyapriya@gmail.com" \
target="_blank">sahoo.satyapriya@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>  I am using \
Axis2-1.5.1 with JDK1.6.</div><div><br></div><div>I have written 1 module to write \
the SOAP Messages. Here I am acting as a <b>server</b>.</div><div>When it is trying \
to write the SOAP ENVELOPE IN Message, it is throwing the Bellow \
Exception</div><div><br></div><div><div>18 Aug 2015 13:03:41,956 - ERROR invoke \
(TestHandler.java:66) - Exception Occured while logging the message  \
</div><div><b>org.apache.axiom.om.OMException: Parser has already reached end of the \
document. No siblings found</b></div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:339)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axiom.om.impl.traverse.OMChildrenIterator.next(OMChildrenIterator.java:102)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:953)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:227)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:387)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1106)</div><div><span \
style="white-space:pre-wrap">	</span>at \
com.synchronoss.webservice.itsm.logger.TestHandler.invoke(TestHandler.java:34)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.engine.Phase.invoke(Phase.java:318)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:508)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:423)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:386)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:176)</div><div><span \
style="white-space:pre-wrap">	</span>at \
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)</div><div><span \
style="white-space:pre-wrap">	</span>at \
javax.servlet.http.HttpServlet.service(HttpServlet.java:820)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)</div><div><span \
style="white-space:pre-wrap">	</span>at \
weblogic.work.ExecuteThread.run(ExecuteThread.java:176)</div></div><div><br></div><div><br></div><div>STEPS \
I followed :</div><div><br></div><div><b>Created 1 \
TestModule.java</b></div><div><br></div><div><div>package \
com.test.logger;</div><div><br></div><div>import \
org.apache.axis2.AxisFault;</div><div>import \
org.apache.axis2.context.ConfigurationContext;</div><div>import \
org.apache.axis2.description.AxisDescription;</div><div>import \
org.apache.axis2.description.AxisModule;</div><div>import \
org.apache.axis2.modules.Module;</div><div>import \
org.apache.neethi.Assertion;</div><div>import \
org.apache.neethi.Policy;</div><div><br></div><div>public class TestModule implements \
Module{</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>@Override</div><div><span \
style="white-space:pre-wrap">	</span>public void applyPolicy(Policy arg0, \
AxisDescription arg1) throws AxisFault {</div><div><span \
style="white-space:pre-wrap">		</span>// TODO Auto-generated method \
stub</div><div><span style="white-space:pre-wrap">		</span></div><div><span \
style="white-space:pre-wrap">	</span>}</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>@Override</div><div><span \
style="white-space:pre-wrap">	</span>public boolean canSupportAssertion(Assertion \
arg0) {</div><div><span style="white-space:pre-wrap">		</span>// TODO Auto-generated \
method stub</div><div><span style="white-space:pre-wrap">		</span>return \
false;</div><div><span \
style="white-space:pre-wrap">	</span>}</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>@Override</div><div><span \
style="white-space:pre-wrap">	</span>public void engageNotify(AxisDescription arg0) \
throws AxisFault {</div><div><span style="white-space:pre-wrap">		</span>// TODO \
Auto-generated method stub</div><div><span \
style="white-space:pre-wrap">		</span></div><div><span \
style="white-space:pre-wrap">	</span>}</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>@Override</div><div><span \
style="white-space:pre-wrap">	</span>public void init(ConfigurationContext arg0, \
AxisModule arg1)</div><div><span style="white-space:pre-wrap">			</span>throws \
AxisFault {</div><div><span style="white-space:pre-wrap">		</span>// TODO \
Auto-generated method stub</div><div><span \
style="white-space:pre-wrap">		</span></div><div><span \
style="white-space:pre-wrap">	</span>}</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>@Override</div><div><span \
style="white-space:pre-wrap">	</span>public void shutdown(ConfigurationContext arg0) \
throws AxisFault {</div><div><span style="white-space:pre-wrap">		</span>// TODO \
Auto-generated method stub</div><div><span \
style="white-space:pre-wrap">		</span></div><div><span \
style="white-space:pre-wrap">	</span>}</div><div><br></div><div>}</div></div><div><br></div><div><b>2) \
Created 1 Handler class</b><br><div>package \
com.test.logger;<br></div><div><br></div><div>import \
org.apache.axis2.AxisFault;</div><div>import \
org.apache.axis2.context.MessageContext;</div><div>import \
org.apache.axis2.context.OperationContext;</div><div>import \
org.apache.axis2.engine.Handler;</div><div>import \
org.apache.axis2.handlers.AbstractHandler;</div><div>import \
org.apache.axis2.wsdl.WSDLConstants;</div><div>import \
org.apache.commons.logging.Log;</div><div>import \
org.apache.commons.logging.LogFactory;</div><div><br></div><div>public class \
TestHandler extends AbstractHandler implements \
Handler{</div><div><br></div><div><span style="white-space:pre-wrap">	</span>private \
static Log log = LogFactory.getLog(TestHandler.class);</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>private String \
name;</div><div><br></div><div><span style="white-space:pre-wrap">	</span>public \
String getName() {</div><div><span style="white-space:pre-wrap">		</span>return \
name;</div><div><span \
style="white-space:pre-wrap">	</span>}</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>public void setName(String name) \
{</div><div><span style="white-space:pre-wrap">		</span>log.debug(&quot;Setting name \
as :&quot;+name);</div><div><span style="white-space:pre-wrap">		</span><a \
href="http://this.name" target="_blank">this.name</a> = name;</div><div><span \
style="white-space:pre-wrap">	</span>}</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>public InvocationResponse invoke(MessageContext \
msgContext) throws AxisFault {</div><div><span \
style="white-space:pre-wrap">		</span>try{</div><div><span \
style="white-space:pre-wrap">			</span>log.debug(&quot;Received \
Request.&quot;);</div><div><span style="white-space:pre-wrap">			</span>StringBuilder \
stringBuilder=new StringBuilder();</div><div><span \
style="white-space:pre-wrap">			</span>OperationContext operationContext = \
msgContext.getOperationContext();</div><div><span \
style="white-space:pre-wrap">			</span>if(operationContext!=null){</div><div><span \
style="white-space:pre-wrap">				</span>MessageContext inMessage = \
operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);</div><div><span \
style="white-space:pre-wrap">				</span><b>String inSoapRequest = \
inMessage.getEnvelope().toString();   \
&lt;-------------------------------------------------------------------------------------Facing \
Problem here</b></div><div><br></div><div><span \
style="white-space:pre-wrap">				</span>MessageContext outMessage = \
operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);</div><div><span \
style="white-space:pre-wrap">				</span>MessageContext faultMessage = \
operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_FAULT_VALUE);</div><div><br></div><div><span \
style="white-space:pre-wrap">				</span>if(outMessage==null&amp;&amp;faultMessage==null){</div><div><span \
style="white-space:pre-wrap">					</span>log.debug(&quot;\n--------------Request \
Received(NEW LOGGER)--------------\n&quot;+inSoapRequest);</div><div><span \
style="white-space:pre-wrap">				</span>}</div><div><span \
style="white-space:pre-wrap">				</span>if(outMessage!=null || \
faultMessage!=null){</div><div><span \
style="white-space:pre-wrap">					</span>stringBuilder.append(&quot;\n-------IN \
MESSAGE(NEW LOGGER)-------\n&quot;);                                                  \
</div><div><span style="white-space:pre-wrap">					</span>stringBuilder.append(inSoapRequest);</div><div><span \
style="white-space:pre-wrap">					</span>stringBuilder.append(&quot;\n-------OUT \
MESSAGE(NEW LOGGER)-------\n&quot;);</div><div><br></div><div><span \
style="white-space:pre-wrap">					</span>if(outMessage!=null){                        \
</div><div><span style="white-space:pre-wrap">						</span>String outMessageEnvelope \
= outMessage.getEnvelope().toString();</div><div><span \
style="white-space:pre-wrap">						</span>stringBuilder.append(outMessageEnvelope);</div><div><span \
style="white-space:pre-wrap">					</span>}</div><div><br></div><div><span \
style="white-space:pre-wrap">					</span>if(faultMessage!=null){</div><div><span \
style="white-space:pre-wrap">						</span>stringBuilder.append(&quot;\n-------FAULT \
MESSAGE(NEW LOGGER)-------\n&quot;);</div><div><span \
style="white-space:pre-wrap">						</span>String faultMessagerEnvelope = \
faultMessage.getEnvelope().toString();</div><div><span \
style="white-space:pre-wrap">						</span>stringBuilder.append(faultMessagerEnvelope);</div><div><span \
style="white-space:pre-wrap">						</span>//                                          \
stringBuilder.append(&quot;\n Fault Envelope : \
&quot;+faultMessagerEnvelope+&quot;\n&quot;);</div><div><span \
style="white-space:pre-wrap">						</span>//                                          \
</blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic