File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services Certification (SCDJWS/OCPJWSD) and the fly likes RMH J2EE WS page 339 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Services Certification (SCDJWS/OCPJWSD)
Reply Bookmark "RMH J2EE WS page 339" Watch "RMH J2EE WS page 339" New topic
Author

RMH J2EE WS page 339

Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 251
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


Thanks,
Santosh
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
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


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 2989
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


Free SCDJWS 5.0 Study Guide - SCDJWS 5.0 Quiz (How to get SCDJWS 5.0 Quiz)
Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz [in progress...]
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
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.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 2989
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

Joined: Nov 07, 2003
Posts: 4982
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

Joined: Apr 04, 2004
Posts: 251
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.
xixi wang
Greenhorn

Joined: May 19, 2004
Posts: 10
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
Ranch Hand

Joined: Jun 04, 2002
Posts: 2989
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.
 
 
subject: RMH J2EE WS page 339
 
Threads others viewed
Finally Got the II & III SCORE (97%)
J2ee Application client module
How to let non-web components use J2EE JNDI Datasources?
JEE 5 and business delegate pattern
J2EE
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture