Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

RMH J2EE WS page 339

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Dynamic Proxy
Folks!
Do we really need to do a JNDI lookup for a service in Stand Alone web services Client ? Can we do it (I mean is it legal to do it)?

I see an example for Dynamice Proxy on pg 339 of RMH's J2EE Web Services that does a JNDI look up in a stand alone application and it confuses me.


Thanks for the help
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For Dynamic Proxy, we know the services we can have, but we dont know where the services are provided, thus, we need to lookup for the services, and JNDI is one of the ways.

Nick
 
Bartender
Posts: 3654
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nicholas,

I don't have RMH book, but I think the original question was: is it possible to use JNDI lookup on J2SE client ? I guess, JNDI is available on J2EE platform only (may be I am wrong).

Cheers,
MZ
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I look at it like this. You have a client which has the J2EE jar files on its classpath. So, a JNDI lookup is done to obtain a javax.xml.rpc.Service object whose getPort() method is invoked. This returns the endpoint interface, thus enabling the client to call one of the interface's business methods.
 
Mikalai Zaikin
Bartender
Posts: 3654
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

Having J2EE jars on CLASSPATH is not enough IMHO to allow client use names lookups.
JNDI is implemented as some server - it needs to listen some port on some host, as well it must have some config files.

cheers,
MZ
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, you must have somewhere to hold (or bind) the JNDI reference.

I am currently studying IBM 288, and thus, if you have configure the some JNDI to the web services endpoints, even you use J2SE clients, you can lookup the web services endpoints.

It is always possible to have any Java clients that access to the JNDI context, as the Service Locator pattern does not apply to J2EE platform solely.

Nick
 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Taking points from your discussion I will go home and look at the example again and see if makes sense to me. Please continue the discussion, may be I can get more of this.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Nicholas Cheung. In EJB, a standalone client (not in a container) can still do JNDI lookup on the bean instances via the jar file which packages the bean information (home interface, remote interface, bean instance, etc).
 
Mikalai Zaikin
Bartender
Posts: 3654
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

Well, client not in EJB container anyway need network access to JNDI implementation. It can use JNDI network connection to EJB container it working with.

As for Web Services - one of the declared advantages is ability to work behind firewall, using HTTP protocol only. This means either JNDI directory has to be running and be accessed locally (not the case when use J2SE), or J2SE Web Services client has to connect to remote JNDI directory (may not the case because all ports except HTTP (80/8080/9080) can be blocked).

So, let's assume that J2SE Web Services client connects to its endpoint's JNDI directory and firewalls do no block these connections.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic