dev@jersey.java.net

RE: [Jersey] Referencing JAX-RS based WebService

From: Markus KARG <markus.karg_at_gmx.net>
Date: Wed, 17 Dec 2008 20:00:24 +0100

Ok I will file a feature request in the next days, but I share your concerns
that it will be hard to find a technological way to inject something as
there is "nothing" on the client side that could get injected -- despite the
host address itself. I think we could let this open to the GlassFish guys.
Maybe they have a brilliant idea. It is already possible to inject URLs so
it should be easy for them to define some tweak that does inject the actual
host's root URL instead of a user supplied String value.

 

Regards

Markus

 

From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
Sent: Mittwoch, 17. Dezember 2008 18:03
To: dev_at_jersey.dev.java.net
Cc: dev_at_glassfish.dev.java.net
Subject: Re: [Jersey] Referencing JAX-RS based WebService

 

 

On Dec 17, 2008, at 5:49 PM, Markus KARG wrote:





Paul,

 

thanks for your support. But I do not understand why to log a BUG (I mean,
nothing is broken)? Wouldn't it be better to log a RFE in the GlassFish
tracker that JAX-RS deployed clients shall get injected some kind of context
like this?

 

 

Sorry for the confusion, i was using bug/issue interchangeably. You are
right, an issue marked as a feature would be best.

 

I am not too clear on the exact technical details but i guess that this does
not need to be JAX-RS specific and there could be some general ACC context
from which the base URI could be obtained. Since the JAX-RS client is
general and not specific to any server side artifact (there is no dynamic
proxy or generation step as is the case with JAX-WS) i am not sure how
anything can get injected. Perhaps something like this would work:

 

  ACCContext accc = ACCContext,getInstance();

  Client c = Client.create();

  WebResource r = c.resource(accc.getBaseUri());

 

?

 

Paul.

 

Regards

Markus

 

From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
Sent: Mittwoch, 17. Dezember 2008 11:58
To: dev_at_jersey.dev.java.net
Cc: dev_at_glassfish.dev.java.net
Subject: Re: [Jersey] Referencing JAX-RS based WebService

 

HI Markus,

 

It seems that what you require would also be useful for any "web start"
application that requires the root or "bootstrap" URL whether it be
Swing-based or not. IIUC what you really require is the root URL of a
servlet or host? i.e. it should not need to be specific to a particular
deployed technology and perhaps we require an Application Client Context API
to obtain the information.

 

I recommend logging a bug. I would also like to know where the JAX-WS code
resides to obtain the root URL, perhaps there is something we can reuse?

 

Paul.

 

On Dec 17, 2008, at 8:07 AM, Markus Karg wrote:






Hi all,

 

I just stumbled over the problem that my standalone Swing client (running in
the GlassFish Application Client Container) wants to call my JAX-RS based
service running in the GlassFish Server Container. Both, client and service,
are deployed using a single EAR. Now certainly my client needs to know the
root URL of the service. But how to find out at runtime? Tim Quinn and
Bhakti Mehta had the idea that the client shall call a "fake" JAX-WS-based
service, since for this kind of call the client gets injected a WS port and
can ask the port for the host's root URL. Ok, this will work. But certainly
it would be great to have a JAX-RS-only solution, without JAX-WS-fakes. Is
there a solution planned for this kind of problem? Maybe in future it will
be possible to have the URLs injected into the client? Or shall I open an
issue in the GlassFish tracker?

 

QUIPSY QUALITY GmbH & Co. KG

Ein Unternehmen der MES-Gruppe

Stuttgarter Strasse 23

D-75179 Pforzheim

Tel: 07231-9189-52

Fax: 07231-9189-59

www.quipsy.de

karg_at_quipsy.de

Registergericht Mannheim HRA 701214

Geschäftsführer: Nils Schroeder

 

Diese E-Mail enthält persönliche, vertrauliche und vor Weitergabe geschützte
Informationen und ist ausschließlich für den vorgesehenen o.g. Empfänger
(Adressaten) bestimmt. Falls Sie diese E-Mail versehentlich erhalten haben
und nicht der vorgesehene Empfänger sind, bitten wir Sie, die E-Mail und
deren Anhänge nicht aufzubewahren, nicht zu vervielfältigen, nicht zu nutzen
und nicht weiterzugeben. Bitte informieren Sie uns als Absender über diesen
Zustellungsfehler und löschen Sie die E-Mail.

 

 

<image001.jpg>

 

<Markus KARG.vcf>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
For additional commands, e-mail: dev-help_at_jersey.dev.java.net