You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Thomas Van de Velde <th...@gmail.com> on 2006/04/25 19:07:19 UTC

[axis2] Setting EndPoint in Module -> nullpointer

Hello,

I am trying to set the endpointreference in a module so that the client code
does not need to be aware of the endpoint details.  The goal is that  this
module takes over responsibility of  setting the endpoint.

When taking out options.setTo(...) from the client, I get an error
indicating that the transport cannot be determined.("Cannot infer transport
information from the URL information provided")  I've fixed this by setting
the TransportIn and TransportOut options.  Now Axis is able to determine the
transport details.  However I am getting now getting a nullpointer exception
in AxisEngine.send() line 544.

I am using axis2 v0.95

Client options:

            Options options = new Options();
            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
            options.setTranportOut(new TransportOutDescription(new QName(
                    Constants.TRANSPORT_HTTP)));
            options.setUseSeparateListener(false);

Handler code:

public void invoke(MessageContext msgContext) throws AxisFault {
    public static EndpointReference EPR = new EndpointReference(
            "http://localhost:8080/axis2/services/sample-provider");
        msgContext.setTo(EPR);
        log.info(msgContext.getEnvelope().toString());
    }

All the rest of the configuration (axis2.xml and module.xml) is identical to
the LoggingModule sample.

I guess this should be raised as a JIRA issue.  Anything I can do to get
past the nullpointer?

Cheers,
Thomas

Re: [axis2] Setting EndPoint in Module -> nullpointer

Posted by Thomas Van de Velde <th...@gmail.com>.
Hi,

The point is that I do not want to set an EPR in the client but defer that
decision until later in the handler chain.

That way I could write a dynamic addressing handler.

Thomas

On 4/25/06, Eran Chinthaka <ch...@opensource.lk> wrote:
>
> Hi Thomas,
>
> You don't need to call setTranportOut, if your toEPR says it over HTTP.
>
> Anyway, please create a JIRA on this and if possible please explain a
> way to re-produce this. You might want to attach some code you have
> already written :).
>
> -- Chinthaka
>
>
> Thomas Van de Velde wrote:
> > Hello,
> >
> > I am trying to set the endpointreference in a module so that the client
> > code does not need to be aware of the endpoint details.  The goal is
> > that  this module takes over responsibility of  setting the endpoint.
> >
> > When taking out options.setTo(...) from the client, I get an error
> > indicating that the transport cannot be determined.("Cannot infer
> > transport information from the URL information provided")  I've fixed
> > this by setting the TransportIn and TransportOut options.  Now Axis is
> > able to determine the transport details.  However I am getting now
> > getting a nullpointer exception in AxisEngine.send() line 544.
> >
> > I am using axis2 v0.95
> >
> > Client options:
> >
> >             Options options = new Options();
> >             options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
> >             options.setTranportOut(new TransportOutDescription(new
> QName(
> >                     Constants.TRANSPORT_HTTP)));
> >             options.setUseSeparateListener(false);
> >
> > Handler code:
> >
> > public void invoke(MessageContext msgContext) throws AxisFault {
> >     public static EndpointReference EPR = new EndpointReference(
> >             "http://localhost:8080/axis2/services/sample-provider");
> >         msgContext.setTo(EPR);
> >         log.info(msgContext.getEnvelope().toString());
> >     }
> >
> > All the rest of the configuration (axis2.xml and module.xml) is
> > identical to the LoggingModule sample.
> >
> > I guess this should be raised as a JIRA issue.  Anything I can do to get
> > past the nullpointer?
> >
> > Cheers,
> > Thomas
>
>
>
>
>

Re: [axis2] Setting EndPoint in Module -> nullpointer

Posted by Eran Chinthaka <ch...@opensource.lk>.
Hi Thomas,

You don't need to call setTranportOut, if your toEPR says it over HTTP.

Anyway, please create a JIRA on this and if possible please explain a
way to re-produce this. You might want to attach some code you have
already written :).

-- Chinthaka


Thomas Van de Velde wrote:
> Hello,
> 
> I am trying to set the endpointreference in a module so that the client
> code does not need to be aware of the endpoint details.  The goal is
> that  this module takes over responsibility of  setting the endpoint. 
> 
> When taking out options.setTo(...) from the client, I get an error
> indicating that the transport cannot be determined.("Cannot infer
> transport information from the URL information provided")  I've fixed
> this by setting the TransportIn and TransportOut options.  Now Axis is
> able to determine the transport details.  However I am getting now
> getting a nullpointer exception in AxisEngine.send() line 544.
> 
> I am using axis2 v0.95
> 
> Client options:
> 
>             Options options = new Options();
>             options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>             options.setTranportOut(new TransportOutDescription(new QName(
>                     Constants.TRANSPORT_HTTP)));
>             options.setUseSeparateListener(false);
> 
> Handler code:
> 
> public void invoke(MessageContext msgContext) throws AxisFault {
>     public static EndpointReference EPR = new EndpointReference(
>             "http://localhost:8080/axis2/services/sample-provider");
>         msgContext.setTo(EPR);
>         log.info(msgContext.getEnvelope().toString());
>     }
> 
> All the rest of the configuration (axis2.xml and module.xml) is
> identical to the LoggingModule sample.
> 
> I guess this should be raised as a JIRA issue.  Anything I can do to get
> past the nullpointer?
> 
> Cheers,
> Thomas



Re: [axis2] Setting EndPoint in Module -> nullpointer

Posted by Thomas Van de Velde <th...@gmail.com>.
I think I found the problem.

The sender retrieved by AxisEngine in

TransportOutDescription transportOut = msgContext.getTransportOut();
TransportSender sender = transportOut.getSender();

returns null.

When invoke is called, you get a nullpointer.

However my TransportOutDescription was set in the client:

options.setTranportOut(new TransportOutDescription(new QName(
                    Constants.TRANSPORT_HTTP)));

I've filed http://issues.apache.org/jira/browse/AXIS2-619

Thomas


On 4/26/06, robert lazarski <ro...@gmail.com> wrote:
>
> The point being you need to make sure you can call setTO() by knowing what
> phase your in. AbstractHandler.invoke() will be called by all phases if
> indeed you are following the loggging.mar code.
>
> What I showed is a solution for getting an EPR without NPE by calling the
> right phase. You're setting the EPR, however ;-) . I think I get what you
> are trying to do now.
>
> The logging.mar is an example that places phases after the system
> predefined phases,  yet an EPR is AFAIK expected to be set before the user
> phases, due to that AxisEngine is called before the user phases and the
> EPR's are initialized for the MessageContext methods such as getTO() .
>
> My two reccomendations are:
>
> 1) Use RC2. If you end up filing a Jira that's the best code base to do it
> from .
> 2) Look at the Transport and Dispatch phases to see if you can actually
> set the EPR after those phases.
>
> HTH,
> Robert
> http://www.braziloutsource.com
>
>
> On 4/25/06, Thomas Van de Velde < thomas.vdvelde@gmail.com> wrote:
> >
> > Hi Robert,
> >
> > I am not sure how this is related to my problem. The idea is to defer
> > the definition of an EPR at the end of the processing pipeline and not in
> > the client code.
> >
> > Thomas
> >
> >
> >  On 4/25/06, robert lazarski <ro...@gmail.com> wrote:
> > >
> > > Incidently, I'm not sure what one would do here on:
> > >
> > > else if (messageContext.getFLOW() == MessageContext.OUT_FAULT_FLOW)
> > >
> > > As I don't see how to get the EPR in this case. That might not be a
> > > valid case though.
> > >
> > >
> > > Robert
> > > http://www.braziloutsource.com/
> > >
> > > On 4/25/06, robert lazarski < robertlazarski@gmail.com> wrote:
> > > >
> > > > You need to be able to determine how to get the endpoint via the
> > > > Flows, such as:
> > > >
> > > > EndpointReference ref = null;
> > > >
> > > >     // Get id, type and content
> > > >     Long    id;
> > > >     Integer type;
> > > >     // 'soap request' must be called first
> > > >     if (messageContext.getFLOW() == MessageContext.IN_FLOW) {
> > > >         // show soap message inside the 'soap request' pane in the
> > > > applet
> > > >         id = assignMessageId(messageContext);
> > > >         type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_REQUEST
> > > > );
> > > >         ref = messageContext.getTo();
> > > >     } else if (messageContext.getFLOW() == MessageContext.OUT_FLOW)
> > > > {
> > > >         id = getMessageId(messageContext);
> > > >         // show soap message inside the 'soap response' pane in the
> > > > applet
> > > >         type = new Integer(
> > > > SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
> > > >         ref = messageContext.getFrom();
> > > >     } else if (messageContext.getFLOW() ==
> > > > MessageContext.IN_FAULT_FLOW) {
> > > >         id = getMessageId(messageContext);
> > > >         // show soap message inside the 'soap response' pane in the
> > > > applet
> > > >         type = new Integer(
> > > > SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
> > > >         ref = messageContext.getFaultTo();
> > > >     } else {
> > > >         throw new IllegalStateException("unknown FLOW detected in
> > > > messageContext: " + messageContext.getFLOW());
> > > >     }
> > > >
> > > > Another way to do this would be labels.
> > > >
> > > > HTH,
> > > > Robert
> > > > http://www.braziloutsource.com/
> > > >
> > >
>
>  On 4/25/06, Thomas Van de Velde < thomas.vdvelde@gmail.com> wrote:
> > > > >
> > > > > Hello,
> > > > >
> > > > > I am trying to set the endpointreference in a module so that the
> > > > > client code does not need to be aware of the endpoint details.  The goal is
> > > > > that  this module takes over responsibility of  setting the endpoint.
> > > > >
> > > > > When taking out options.setTo(...) from the client, I get an error
> > > > > indicating that the transport cannot be determined.("Cannot infer transport
> > > > > information from the URL information provided")  I've fixed this by setting
> > > > > the TransportIn and TransportOut options.  Now Axis is able to determine the
> > > > > transport details.  However I am getting now getting a nullpointer exception
> > > > > in AxisEngine.send() line 544.
> > > > >
> > > > > I am using axis2 v0.95
> > > > >
> > > > > Client options:
> > > > >
> > > > >             Options options = new Options();
> > > > >             options.setTransportInProtocol(
> > > > > Constants.TRANSPORT_HTTP);
> > > > >             options.setTranportOut(new TransportOutDescription(new
> > > > > QName(
> > > > >                     Constants.TRANSPORT_HTTP)));
> > > > >             options.setUseSeparateListener(false);
> > > > >
> > > > > Handler code:
> > > > >
> > > > > public void invoke(MessageContext msgContext) throws AxisFault {
> > > > >     public static EndpointReference EPR = new EndpointReference(
> > > > >             " http://localhost:8080/axis2/services/sample-provider
> > > > > ");
> > > > >         msgContext.setTo(EPR);
> > > > >         log.info(msgContext.getEnvelope().toString());
> > > > >     }
> > > > >
> > > > > All the rest of the configuration (axis2.xml and module.xml) is
> > > > > identical to the LoggingModule sample.
> > > > >
> > > > > I guess this should be raised as a JIRA issue.  Anything I can do
> > > > > to get past the nullpointer?
> > > > >
> > > > > Cheers,
> > > > > Thomas
> > > > >
> > > >
> > > >
> > >
> >
>

Re: [axis2] Setting EndPoint in Module -> nullpointer

Posted by robert lazarski <ro...@gmail.com>.
The point being you need to make sure you can call setTO() by knowing what
phase your in. AbstractHandler.invoke() will be called by all phases if
indeed you are following the loggging.mar code.

What I showed is a solution for getting an EPR without NPE by calling the
right phase. You're setting the EPR, however ;-) . I think I get what you
are trying to do now.

The logging.mar is an example that places phases after the system predefined
phases,  yet an EPR is AFAIK expected to be set before the user phases, due
to that AxisEngine is called before the user phases and the EPR's are
initialized for the MessageContext methods such as getTO() .

My two reccomendations are:

1) Use RC2. If you end up filing a Jira that's the best code base to do it
from .
2) Look at the Transport and Dispatch phases to see if you can actually set
the EPR after those phases.

HTH,
Robert
http://www.braziloutsource.com


On 4/25/06, Thomas Van de Velde <th...@gmail.com> wrote:
>
> Hi Robert,
>
> I am not sure how this is related to my problem. The idea is to defer the
> definition of an EPR at the end of the processing pipeline and not in the
> client code.
>
> Thomas
>
>
>  On 4/25/06, robert lazarski <ro...@gmail.com> wrote:
> >
> > Incidently, I'm not sure what one would do here on:
> >
> > else if (messageContext.getFLOW() == MessageContext.OUT_FAULT_FLOW)
> >
> > As I don't see how to get the EPR in this case. That might not be a
> > valid case though.
> >
> >
> > Robert
> > http://www.braziloutsource.com/
> >
> > On 4/25/06, robert lazarski < robertlazarski@gmail.com> wrote:
> > >
> > > You need to be able to determine how to get the endpoint via the
> > > Flows, such as:
> > >
> > > EndpointReference ref = null;
> > >
> > >     // Get id, type and content
> > >     Long    id;
> > >     Integer type;
> > >     // 'soap request' must be called first
> > >     if (messageContext.getFLOW() == MessageContext.IN_FLOW) {
> > >         // show soap message inside the 'soap request' pane in the
> > > applet
> > >         id = assignMessageId(messageContext);
> > >         type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_REQUEST);
> > >         ref = messageContext.getTo();
> > >     } else if (messageContext.getFLOW() == MessageContext.OUT_FLOW) {
> > >         id = getMessageId(messageContext);
> > >         // show soap message inside the 'soap response' pane in the
> > > applet
> > >         type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE
> > > );
> > >         ref = messageContext.getFrom();
> > >     } else if (messageContext.getFLOW() ==
> > > MessageContext.IN_FAULT_FLOW) {
> > >         id = getMessageId(messageContext);
> > >         // show soap message inside the 'soap response' pane in the
> > > applet
> > >         type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE
> > > );
> > >         ref = messageContext.getFaultTo();
> > >     } else {
> > >         throw new IllegalStateException("unknown FLOW detected in
> > > messageContext: " + messageContext.getFLOW());
> > >     }
> > >
> > > Another way to do this would be labels.
> > >
> > > HTH,
> > > Robert
> > > http://www.braziloutsource.com/
> > >
> >

 On 4/25/06, Thomas Van de Velde < thomas.vdvelde@gmail.com> wrote:
> > > >
> > > > Hello,
> > > >
> > > > I am trying to set the endpointreference in a module so that the
> > > > client code does not need to be aware of the endpoint details.  The goal is
> > > > that  this module takes over responsibility of  setting the endpoint.
> > > >
> > > > When taking out options.setTo(...) from the client, I get an error
> > > > indicating that the transport cannot be determined.("Cannot infer transport
> > > > information from the URL information provided")  I've fixed this by setting
> > > > the TransportIn and TransportOut options.  Now Axis is able to determine the
> > > > transport details.  However I am getting now getting a nullpointer exception
> > > > in AxisEngine.send() line 544.
> > > >
> > > > I am using axis2 v0.95
> > > >
> > > > Client options:
> > > >
> > > >             Options options = new Options();
> > > >             options.setTransportInProtocol(Constants.TRANSPORT_HTTP
> > > > );
> > > >             options.setTranportOut(new TransportOutDescription(new
> > > > QName(
> > > >                     Constants.TRANSPORT_HTTP)));
> > > >             options.setUseSeparateListener(false);
> > > >
> > > > Handler code:
> > > >
> > > > public void invoke(MessageContext msgContext) throws AxisFault {
> > > >     public static EndpointReference EPR = new EndpointReference(
> > > >             " http://localhost:8080/axis2/services/sample-provider
> > > > ");
> > > >         msgContext.setTo(EPR);
> > > >         log.info(msgContext.getEnvelope().toString());
> > > >     }
> > > >
> > > > All the rest of the configuration (axis2.xml and module.xml) is
> > > > identical to the LoggingModule sample.
> > > >
> > > > I guess this should be raised as a JIRA issue.  Anything I can do to
> > > > get past the nullpointer?
> > > >
> > > > Cheers,
> > > > Thomas
> > > >
> > >
> > >
> >
>

Re: [axis2] Setting EndPoint in Module -> nullpointer

Posted by Thomas Van de Velde <th...@gmail.com>.
Hi Robert,

I am not sure how this is related to my problem. The idea is to defer the
definition of an EPR at the end of the processing pipeline and not in the
client code.

Thomas

On 4/25/06, robert lazarski <ro...@gmail.com> wrote:
>
> Incidently, I'm not sure what one would do here on:
>
> else if (messageContext.getFLOW() == MessageContext.OUT_FAULT_FLOW)
>
> As I don't see how to get the EPR in this case. That might not be a valid
> case though.
>
>
> Robert
> http://www.braziloutsource.com/
>
> On 4/25/06, robert lazarski < robertlazarski@gmail.com> wrote:
> >
> > You need to be able to determine how to get the endpoint via the Flows,
> > such as:
> >
> > EndpointReference ref = null;
> >
> >     // Get id, type and content
> >     Long    id;
> >     Integer type;
> >     // 'soap request' must be called first
> >     if (messageContext.getFLOW() == MessageContext.IN_FLOW) {
> >         // show soap message inside the 'soap request' pane in the
> > applet
> >         id = assignMessageId(messageContext);
> >         type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_REQUEST);
> >         ref = messageContext.getTo();
> >     } else if (messageContext.getFLOW() == MessageContext.OUT_FLOW) {
> >         id = getMessageId(messageContext);
> >         // show soap message inside the 'soap response' pane in the
> > applet
> >         type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
> >         ref = messageContext.getFrom();
> >     } else if (messageContext.getFLOW() == MessageContext.IN_FAULT_FLOW)
> > {
> >         id = getMessageId(messageContext);
> >         // show soap message inside the 'soap response' pane in the
> > applet
> >         type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
> >         ref = messageContext.getFaultTo();
> >     } else {
> >         throw new IllegalStateException("unknown FLOW detected in
> > messageContext: " + messageContext.getFLOW());
> >     }
> >
> > Another way to do this would be labels.
> >
> > HTH,
> > Robert
> > http://www.braziloutsource.com/
> >
> >
> > On 4/25/06, Thomas Van de Velde < thomas.vdvelde@gmail.com> wrote:
> > >
> > > Hello,
> > >
> > > I am trying to set the endpointreference in a module so that the
> > > client code does not need to be aware of the endpoint details.  The goal is
> > > that  this module takes over responsibility of  setting the endpoint.
> > >
> > > When taking out options.setTo(...) from the client, I get an error
> > > indicating that the transport cannot be determined.("Cannot infer transport
> > > information from the URL information provided")  I've fixed this by setting
> > > the TransportIn and TransportOut options.  Now Axis is able to determine the
> > > transport details.  However I am getting now getting a nullpointer exception
> > > in AxisEngine.send() line 544.
> > >
> > > I am using axis2 v0.95
> > >
> > > Client options:
> > >
> > >             Options options = new Options();
> > >             options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
> > >             options.setTranportOut(new TransportOutDescription(new
> > > QName(
> > >                     Constants.TRANSPORT_HTTP)));
> > >             options.setUseSeparateListener(false);
> > >
> > > Handler code:
> > >
> > > public void invoke(MessageContext msgContext) throws AxisFault {
> > >     public static EndpointReference EPR = new EndpointReference(
> > >             " http://localhost:8080/axis2/services/sample-provider");
> > >         msgContext.setTo(EPR);
> > >         log.info(msgContext.getEnvelope().toString());
> > >     }
> > >
> > > All the rest of the configuration (axis2.xml and module.xml) is
> > > identical to the LoggingModule sample.
> > >
> > > I guess this should be raised as a JIRA issue.  Anything I can do to
> > > get past the nullpointer?
> > >
> > > Cheers,
> > > Thomas
> > >
> >
> >
>

Re: [axis2] Setting EndPoint in Module -> nullpointer

Posted by robert lazarski <ro...@gmail.com>.
Incidently, I'm not sure what one would do here on:

else if (messageContext.getFLOW() == MessageContext.OUT_FAULT_FLOW)

As I don't see how to get the EPR in this case. That might not be a valid
case though.

Robert
http://www.braziloutsource.com/

On 4/25/06, robert lazarski <ro...@gmail.com> wrote:
>
> You need to be able to determine how to get the endpoint via the Flows,
> such as:
>
> EndpointReference ref = null;
>
>     // Get id, type and content
>     Long    id;
>     Integer type;
>     // 'soap request' must be called first
>     if (messageContext.getFLOW() == MessageContext.IN_FLOW) {
>         // show soap message inside the 'soap request' pane in the applet
>         id = assignMessageId(messageContext);
>         type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_REQUEST);
>         ref = messageContext.getTo();
>     } else if (messageContext.getFLOW() == MessageContext.OUT_FLOW) {
>         id = getMessageId(messageContext);
>         // show soap message inside the 'soap response' pane in the applet
>         type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
>         ref = messageContext.getFrom();
>     } else if (messageContext.getFLOW() == MessageContext.IN_FAULT_FLOW) {
>         id = getMessageId(messageContext);
>         // show soap message inside the 'soap response' pane in the applet
>         type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
>         ref = messageContext.getFaultTo();
>     } else {
>         throw new IllegalStateException("unknown FLOW detected in
> messageContext: " + messageContext.getFLOW());
>     }
>
> Another way to do this would be labels.
>
> HTH,
> Robert
> http://www.braziloutsource.com/
>
>
> On 4/25/06, Thomas Van de Velde < thomas.vdvelde@gmail.com> wrote:
> >
> > Hello,
> >
> > I am trying to set the endpointreference in a module so that the client
> > code does not need to be aware of the endpoint details.  The goal is that
> > this module takes over responsibility of  setting the endpoint.
> >
> > When taking out options.setTo(...) from the client, I get an error
> > indicating that the transport cannot be determined.("Cannot infer transport
> > information from the URL information provided")  I've fixed this by setting
> > the TransportIn and TransportOut options.  Now Axis is able to determine the
> > transport details.  However I am getting now getting a nullpointer exception
> > in AxisEngine.send() line 544.
> >
> > I am using axis2 v0.95
> >
> > Client options:
> >
> >             Options options = new Options();
> >             options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
> >             options.setTranportOut(new TransportOutDescription(new
> > QName(
> >                     Constants.TRANSPORT_HTTP)));
> >             options.setUseSeparateListener(false);
> >
> > Handler code:
> >
> > public void invoke(MessageContext msgContext) throws AxisFault {
> >     public static EndpointReference EPR = new EndpointReference(
> >             " http://localhost:8080/axis2/services/sample-provider");
> >         msgContext.setTo(EPR);
> >         log.info(msgContext.getEnvelope().toString());
> >     }
> >
> > All the rest of the configuration (axis2.xml and module.xml) is
> > identical to the LoggingModule sample.
> >
> > I guess this should be raised as a JIRA issue.  Anything I can do to get
> > past the nullpointer?
> >
> > Cheers,
> > Thomas
> >
>
>

Re: [axis2] Setting EndPoint in Module -> nullpointer

Posted by robert lazarski <ro...@gmail.com>.
You need to be able to determine how to get the endpoint via the Flows, such
as:

EndpointReference ref = null;

    // Get id, type and content
    Long    id;
    Integer type;
    // 'soap request' must be called first
    if (messageContext.getFLOW() == MessageContext.IN_FLOW) {
        // show soap message inside the 'soap request' pane in the applet
        id = assignMessageId(messageContext);
        type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_REQUEST);
        ref = messageContext.getTo();
    } else if (messageContext.getFLOW() == MessageContext.OUT_FLOW) {
        id = getMessageId(messageContext);
        // show soap message inside the 'soap response' pane in the applet
        type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
        ref = messageContext.getFrom();
    } else if (messageContext.getFLOW() == MessageContext.IN_FAULT_FLOW) {
        id = getMessageId(messageContext);
        // show soap message inside the 'soap response' pane in the applet
        type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
        ref = messageContext.getFaultTo();
    } else {
        throw new IllegalStateException("unknown FLOW detected in
messageContext: " + messageContext.getFLOW());
    }

Another way to do this would be labels.

HTH,
Robert
http://www.braziloutsource.com/

On 4/25/06, Thomas Van de Velde <th...@gmail.com> wrote:
>
> Hello,
>
> I am trying to set the endpointreference in a module so that the client
> code does not need to be aware of the endpoint details.  The goal is that
> this module takes over responsibility of  setting the endpoint.
>
> When taking out options.setTo(...) from the client, I get an error
> indicating that the transport cannot be determined.("Cannot infer transport
> information from the URL information provided")  I've fixed this by setting
> the TransportIn and TransportOut options.  Now Axis is able to determine the
> transport details.  However I am getting now getting a nullpointer exception
> in AxisEngine.send() line 544.
>
> I am using axis2 v0.95
>
> Client options:
>
>             Options options = new Options();
>             options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>             options.setTranportOut(new TransportOutDescription(new QName(
>                     Constants.TRANSPORT_HTTP)));
>             options.setUseSeparateListener(false);
>
> Handler code:
>
> public void invoke(MessageContext msgContext) throws AxisFault {
>     public static EndpointReference EPR = new EndpointReference(
>             "http://localhost:8080/axis2/services/sample-provider");
>         msgContext.setTo(EPR);
>         log.info(msgContext.getEnvelope().toString());
>     }
>
> All the rest of the configuration (axis2.xml and module.xml) is identical
> to the LoggingModule sample.
>
> I guess this should be raised as a JIRA issue.  Anything I can do to get
> past the nullpointer?
>
> Cheers,
> Thomas
>