Scott,

the problem with the JNDI lookup of org.apache.axis.client.Service lies
within
the org.apache.axis.client.ServiceFactory.

It wants either the service classname or the WSDL location. If neither is
set, it'll
return null.

The JNDI spec allows for a null return from ObjectFactory.getObjectInstance
when the object cannot be created.

Cheers
-thomas

-----Original Message-----
From: Thomas Diesler [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 13, 2003 9:44 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [JBoss-dev] JNDI lookup problem with webservice client



... here is the test:
org.jboss.test.webservice.ws4eeclient.HelloClientTestCase

thanks
-thomas

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Behalf Of Scott
> M Stark
> Sent: Tuesday, November 11, 2003 9:43 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-dev] JNDI lookup problem with webservice client
>
>
> No, not that I can see from this. Check the test in and let
> me look at it.
>
> --
> xxxxxxxxxxxxxxxxxxxxxxxx
> Scott Stark
> Chief Technology Officer
> JBoss Group, LLC
> xxxxxxxxxxxxxxxxxxxxxxxx
>
> [EMAIL PROTECTED] wrote:
>
> > Scott,
> >
> > working on the webservice client programing model, I need
> to bind a javax.xml.rpc.Service to JNDI. In the test below I
> bind it to the global JNDI namespace. However, when I lookup
> the service I get null without a NamingException.
> >
> > The code below first tests if the service object can be
> serialized without JNDI involvement, then it tests if
> bind/lookup of a trival string object works. Finally the
> actual service is bound (I can see it in jmx-console) and
> then looked up again. The last assertion fails.
> >
> > Any idea?
> >
> > cheers
> > -thomas
> >
> > ----------------------
> >
> >       String SERVICE_JNDI_NAME = "service/HelloWsService1";
> >
> >       Service service = new org.apache.axis.client.Service();
> >
> >       // first try to marshal/unmarshal the service without JNDI
> >       ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
> >       ObjectOutputStream oos = new ObjectOutputStream(baos);
> >       oos.writeObject(service);
> >       oos.close();
> >       ByteArrayInputStream bais = new
> ByteArrayInputStream(baos.toByteArray());
> >       ObjectInputStream ois = new ObjectInputStream(bais);
> >       service = (Service)ois.readObject();
> >       assertNotNull("cannot serialize service", service);
> >
> >       // test JNDI lookup with a trivial String
> >       InitialContext iniCtx = getInitialContext();
> >       Util.bind(iniCtx, SERVICE_JNDI_NAME, "Test JNDI");
> >       assertEquals("Test JNDI", iniCtx.lookup(SERVICE_JNDI_NAME));
> >       Util.unbind(iniCtx, SERVICE_JNDI_NAME);
> >
> >       service = new org.apache.axis.client.Service();
> >
> >       // now do the actual binding and lookup
> >       Util.bind(iniCtx, SERVICE_JNDI_NAME, service);
> >       service = (Service)iniCtx.lookup(SERVICE_JNDI_NAME);
> >       assertNotNull ("cannot lookup service", service);
> >       Util.unbind(iniCtx, SERVICE_JNDI_NAME);
>
>
>



-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to