axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Davis" <...@us.ibm.com>
Subject RE: NullPointerException in ServiceClient
Date Fri, 31 Aug 2001 17:56:50 GMT
Can we always assume that there's a URL?  Isn't that a bit specific
for just certain transports?
-Dug


Glen Daniels <gdaniels@macromedia.com> on 08/31/2001 01:20:35 PM

Please respond to axis-dev@xml.apache.org

To:   "'axis-dev@xml.apache.org'" <axis-dev@xml.apache.org>
cc:
Subject:  RE: NullPointerException in ServiceClient



Hi Ryo, all:

There are a few ways we could go here.

1) take out the reset(), so the value hangs out.  It's a little odd that we
don't do this for every entry point, just the one with the SOAPEnvelope.

2) tie a URL into the Transport object (this asks the question - is there a
direct mapping between a Transport and a URL), and let it always set that
at
setupMessageContext() time.

3) Have the ServiceClient itself set the URL property in invoke(), right
before calling the transport setupMessageContext()

Note that I would suggest putting the reset() in all the invoke()s for
either of the latter two approaches, for consistency.

I rather like the second approach, since our transports really do already
work this way (you give a server+port to a TCPTransport, a URL to an
HTTPTransport, a server to a LocalTransport).  I've implemented a first cut
at this, but will wait to check it in until I hear opinions back from the
group.

--Glen

> -----Original Message-----
> From: Ryo Neyama [mailto:neyama@trl.ibm.co.jp]
> Sent: Friday, August 31, 2001 11:23 AM
> To: axis-dev@xml.apache.org
> Subject: 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
>
>



Mime
View raw message