Thomas,

Another possibility of binding webservices into JNDI is using references and
an associated 
ServiceFactory (see the behaviour of external web service references in
jboss.net).

With that approach, you have more control about the serialisation process,
classloading issues and
engine affiliations.

CGJ


> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Gesendet: Dienstag, 11. November 2003 21:27
> An: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Betreff: [JBoss-dev] JNDI lookup problem with webservice client
> 
> 
> 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
> 
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/


-------------------------------------------------------
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