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 Ryo Neyama <ne...@trl.ibm.co.jp> on 2001/08/31 17:23:26 UTC

NullPointerException in ServiceClient

The following code doesn't work as I expected but it throws
NullPointerException.
SOAPEnvelope reqEnv = ...;
ServiceClient call = new ServiceClient(url);
SOAPEnvelope respEnv = call.invoke(reqEnv);

This is caused by the following code in ServiceClient.
    public SOAPEnvelope invoke(SOAPEnvelope env) throws AxisFault
    {
        msgContext.reset();
        msgContext.setRequestMessage(new Message(env));
        invoke();
        return msgContext.getResponseMessage().getAsSOAPEnvelope();
    }

More specifically, msgContext.reset() removed the url set in the
constructor.

Is this a bug or spec?
If it's spec, why?

    Ryo Neyama @ IBM Research, Tokyo Research Laboratory
    Internet Technology
    neyama@trl.ibm.co.jp