You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Ajith Ranabahu <aj...@gmail.com> on 2006/02/01 04:31:07 UTC

Re: [axis2] MessageContext.responseWritten()

Mesage label ?

On 2/1/06, iksrazal <ik...@gmail.com> wrote:
>
> Hi all,
>
> I'm porting the axis1.x soap monitor to axis2. The request is working
> fine. I
> can't get the response, however, due to this piece of code in its Handler:
>
> // Get id, type and content
>     Long    id;
>     Integer type;
>     if (!messageContext.isResponseWritten()) {
>       id = assignMessageId(messageContext);
>       type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_REQUEST);
>     } else {
>       id = getMessageId(messageContext);
>       type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
>     }
>
> However, MessageContext.setResponseWritten() is not called anywhere, best
> I
> can tell.
>
> My question is: How can I tell that the messageContext contains a response
> ?
>
> This topic was disscussed previously:
>
> http://www.opensubscriber.com/message/axis-dev@ws.apache.org/1800039.html
>
> iksrazal
> http://www.braziloutsource.com/
> --
>



--
Ajith Ranabahu

Re: [axis2] MessageContext.responseWritten()

Posted by iksrazal <ik...@gmail.com>.
I tried: 

// Get id, type and content
    Long    id;
    Integer type;
    MessageContext inMessageContext = messageContext.getOperationContext()
        .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
    if (inMessageContext != null) {
      id = assignMessageId(messageContext);
      // show soap message in 'soap request' pane in the applet
      type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_REQUEST);
    } else {
      id = getMessageId(messageContext);
      // show soap message in 'soap response' pane in the applet
      type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
    }

But 'inMessageContext' is never null . Hmm. I get all the requests and 
responses in the soap applet resquest pane - I just need a simple way to know 
if the soap message is a request or a response. 

iksrazal
http://www.braziloutsource.com/

Em Quarta 01 Fevereiro 2006 01:31, o Ajith Ranabahu escreveu:
> Mesage label ?
>
> On 2/1/06, iksrazal <ik...@gmail.com> wrote:
> > Hi all,
> >
> > I'm porting the axis1.x soap monitor to axis2. The request is working
> > fine. I
> > can't get the response, however, due to this piece of code in its
> > Handler:
> >
> > // Get id, type and content
> >     Long    id;
> >     Integer type;
> >     if (!messageContext.isResponseWritten()) {
> >       id = assignMessageId(messageContext);
> >       type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_REQUEST);
> >     } else {
> >       id = getMessageId(messageContext);
> >       type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
> >     }
> >
> > However, MessageContext.setResponseWritten() is not called anywhere, best
> > I
> > can tell.
> >
> > My question is: How can I tell that the messageContext contains a
> > response ?
> >
> > This topic was disscussed previously:
> >
> > http://www.opensubscriber.com/message/axis-dev@ws.apache.org/1800039.html
> >
> > iksrazal
> > http://www.braziloutsource.com/
> > --
>
> --
> Ajith Ranabahu

--