axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary L Peskin" <ga...@firstech.com>
Subject RE: Generated Class Configuration
Date Thu, 02 Oct 2003 19:19:27 GMT
Tom --

My understanding is different.  

I think the point of JSR 109 is that the port address of the endpoint is
known by the server, not the client.  It is not specified in WSDL as it
normally would be or by the client but at deployment time into the server.

I think Guillaume is trying to return an xxxServiceLocator (not a stub) to
the client such that the getPort(...) method of the returned
xxxServiceLocator will return a stub pointing to the server-known port
address.

In other words, he can't use the WSDL2Java-generated xxxServiceLocator out
of the box because there is no way for him to change the Service_address
String emitted into the class by WSDL2Java.  He needs to change that string
during his deployment/customization process.

Guillaume, can you clarify?

Gary

> -----Original Message-----
> From: Tom Jordahl [mailto:tomj@macromedia.com] 
> Sent: Thursday, October 02, 2003 11:52 AM
> To: 'axis-dev@ws.apache.org'
> Subject: RE: Generated Class Configuration
> 
> 
> 
> If you have the xxxServiceLocator, you can get a Service 
> class that has a different URL in by calling the Service 
> getXXX(URL endpoint) method.  I believe that Guillaume has 
> only a Service class and wants to modify it after it comes 
> from the Locator API.
> 
> --
> Tom Jordahl
> Macromedia Server Development
> 
> -----Original Message-----
> From: Gary L Peskin [mailto:garyp@firstech.com] 
> Sent: Thursday, October 02, 2003 1:16 PM
> To: axis-dev@ws.apache.org
> Subject: RE: Generated Class Configuration
> 
> I think what's happening here is that Guillaume wants to 
> leverage Axis for his JSR 109 implementation in JOnAS.  JSR 
> 109, as I read it, requires the container to return to the 
> client a class that implements the Service interface.  I'll 
> call that class the Service class for shorthand.
> 
> The returned Service class, like all Service classes, needs to have a
> getPort(Class) method.  That method returns a Remote object 
> that acts as a stub, pointing to the service endpoint object, 
> which in Guillaume's case resides on JOnAS.  The problem is 
> the location of the service endpoint object is not known 
> until deployment time.  It is not static in JSR 109 but is 
> specified in a deployment descriptor called webservices.xml.
> 
> The Service object for a particular service endpoint can be 
> configured at deployment time (or run time) and is configured 
> based on information in webservices.xml, not only on the WSDL 
> information.  I think Guillaume would like to use the Service 
> object generated by WSDL2Java which is called 
> xxxServiceLocator.  However, where the generated 
> xxxServiceLocator is created from WSDL (hence the name of the 
> generator WSDL2Java), Guillaume would like the opportunity to 
> further customize the xxxServiceLocator object at run time.
> 
> I think that JSR 109 contemplates a Service object generated 
> at deployment time from webservices.xml.  However, Guillaume 
> would rather use a WSDL2Java-generated object and then 
> customize it at run time.  This means that Guillaume will not 
> have to write a deployment time JSR1092Java generator by himself.
> 
> What he is asking for is that Axis modify WSDL2Java to 
> generate a Service object that can be further customized at 
> run time via removing a "final" qualifier and adding some 
> setXXX methods.
> 
> HTH,
> Gary
> 
> 
> > -----Original Message-----
> > From: Guillaume.Sauthier@Bull.Net 
> [mailto:Guillaume.Sauthier@Bull.Net]
> > Sent: Thursday, October 02, 2003 8:16 AM
> > To: axis-dev@ws.apache.org
> > Subject: Re: Generated Class Configuration
> > 
> > 
> > Just some words for clarification ...
> > 
> > the lookup return an implementation of Service (the
> > GeneratedServiceClass created by WSDL2Java). the user call a 
> > method to get a Stub (it's get<port-name> no ?) the 
> > "container specific class" is the GeneratedServiceClass for 
> > me, and this class doesn't provide API for changing the 
> > endpoint at runtime or for specifying the endpoint to use 
> > within the Stub implementation.
> > 
> > Maybe I doesn't really understand the difference between
> > implemenation of Service and Container Specific Class?
> > 
> > Tom Jordahl wrote:
> > > 
> > > My reading of Roberto's message is that the container returns a
> > > Service object that is an implementation of Service so when 
> > the user
> > > of this class calls the function to get a Stub, the
> > container specific
> > > class will set the right endpoint on that Stub returned from the
> > > getPort() call.
> > > 
> > > If you do it this way, you won't need setEndpoint APIs.
> > But I guess
> > > it wouldn't hurt to have them on the Apache implement of Service.
> > > They would be an Axis extension however....
> > > 
> > > --
> > > Tom Jordahl
> > > Macromedia Server Development
> > > 
> > > -----Original Message-----
> > > From: Guillaume Sauthier [mailto:Guillaume.Sauthier@Bull.Net]
> > > Sent: Thursday, October 02, 2003 10:14 AM
> > > To: axis-dev@ws.apache.org
> > > Subject: Re: Generated Class Configuration
> > > 
> > > Yes that's exactly the point !
> > > The J2EE Application receive from the lookup a configured
> > instance of
> > > Service. And the deployer has the responsability to configure this
> > > instance binded in JNDI. So I should have a way for 
> > properties setting
> > > on the Service instance.
> > > 
> > > Tom Jordahl wrote:
> > > >
> > > > FYI - I asked the JAX-RPC spec lead at Sun about this,
> > here is what
> > > > he said.
> > > >
> > > > --
> > > > Tom Jordahl
> > > > Macromedia Server Development
> > > >
> > > > -----Original Message-----
> > > > From: Roberto Chinnici
> > > > Sent: Wednesday, October 01, 2003 12:50 PM
> > > > To: Tom Jordahl
> > > > Subject: Re: Jax-Rpc issue
> > > >
> > > > No. A J2EE application must use JNDI to lookup a service
> > instance.
> > > > The container can interpose itself and return a service instance
> > > > that will set the endpoint address on the stub before 
> > returning it
> > > > to the application. I should also point out that a
> > deployer may want
> > > > to configure additional stub properties (e.g. for
> > security), so the
> > > > container needs a general way to set properties on the
> > stubs before
> > > > passing them on to the application.
> > > >
> > > > Roberto
> > > >
> > > > Tom Jordahl wrote:
> > > > > Roberto,
> > > > >
> > > > > One of the Axis users wants to send endpoint 
> information on the
> > > > > Service object, so he wants a setEndpoint(URL url) API on it.
> > > > >
> > > > > Is this something JAX-RPC will address?  Does it need to?
> > > > > Thoughts?
> > > > >
> > > > > --
> > > > > Tom Jordahl
> > > > > Macromedia Server Development
> > > > >
> > > > > -----Original Message-----
> > > > > From: Guillaume Sauthier [mailto:Guillaume.Sauthier@Bull.Net]
> > > > > Sent: Wednesday, October 01, 2003 11:46 AM
> > > > > To: axis-dev@ws.apache.org
> > > > > Subject: Re: Generated Class Configuration
> > > > >
> > > > > Ok I watch the source code to understand how to work
> > setProperty.
> > > > > It should be fine but it can't resolve my problem.
> > > > >
> > > > > the setProperty is only usable on the
> > **SoapBindingStub. And this
> > > > > object is created for each <service>.get<port-name>()
> > call on the
> > > > > service interface. And this call is done by the user (in the
> > > > > servlet for example, after the lookup of the service). 
> > So I do not
> > > > > have the Hand on the Stub object that have been
> > instanciated. And
> > > > > so on, I cant use the setProperty on this object :'(.
> > > > >
> > > > > The only reason I can see why this patch may not be
> > good is that
> > > > > the new URL might be a false URL (with no real endpoint at the
> > > > > end)...
> > > > >
> > > > > And for the proposition for geronimo :
> > > > > I think my JSR109 Impl is tightly integrated to JOnAS.
> > It may be
> > > > > difficult to take this functionnality and put it directly in
> > > > > Geronimo. But some parts may be usable (generation tool 
> > turning ON
> > > > > WebServices in EjbJar/War/Ear by creation of wsdd files for
> > > > > example)... Just say that JOnAS is OpenSource and part of the 
> > > > > ObjectWeb Consortium (which will collaborate with Apache and 
> > > > > vice-versa), so sharing should be easy :)
> > > > >
> > > > > Regards
> > > > > Guillaume
> > > > >
> > > > > Tom Jordahl wrote:
> > > > >
> > > > >>No, I think Sam had the right answer.  Set the endpoint
> > property.
> > > > >>This wouldn't be a good patch.
> > > > >>
> > > > >>--
> > > > >>Tom Jordahl
> > > > >>Macromedia Server Development
> > > > >>
> > > > >>-----Original Message-----
> > > > >>From: Davanum Srinivas [mailto:dims@yahoo.com]
> > > > >>Sent: Wednesday, October 01, 2003 10:30 AM
> > > > >>To: axis-dev@ws.apache.org
> > > > >>Subject: Re: Generated Class Configuration
> > > > >>
> > > > >>ok. i see your point. Can you please submit a patch?
> > (remove final
> > > > >>and add setEndpoint method). Here are the instructions for
> > > > >>submitting a patch.
> > > > 
> > >>(http://nagoya.apache.org/wiki/apachewiki.cgi?AxisProjectPag
> > es/SubmitPatches)
> > > > >>
> > > > >>Thanks,
> > > > >>dims
> > > > >>
> > > > >>PS: Is your JSR 109 Impl tight JONAS? We need an 109 impl for
> > > > >>Geronimo
> > > > >>(http://wiki.codehaus.org/geronimo/Architecture/WebServices)
> > > > >>
> > > > >>--- Guillaume Sauthier <Guillaume.Sauthier@Bull.Net> wrote:
> > > > >>
> > > > >>>Thanks for the response :)
> > > > >>>
> > > > >>>Ok, Maybe this time I'll success to explain my problem :)
> > > > >>>
> > > > >>>In fact, what I want to do is to use the generated
> > classes (for
> > > > >>>the client side) with a different Endpoint URL. Because I
am
> > > > >>>integrating Axis in an Application Server, and the 
> > user must get
> > > > >>>an already configured interface when he perform a
> > lookup on the
> > > > >>>service, I have some constraints :
> > > > >>>
> > > > >>>I cant say to the client : "If you use a webservices endpoint
> > > > >>>from a module in the same application unit, you have 
> > to set the
> > > > >>>URL by hand in your code!" It's impossible! Here is a code
> > > > >>>snippet from the spec : <snippet>
> > > > >>>InitialContext ic = new InitialContext();
> > > > >>>AddressBookService abf = (AddressBookService)
> > > > >>>ic.lookup("java:comp/env/service/AddressBookService");
> > > > >>></snippet>
> > > > >>>
> > > > >>>So I have to preconfigure the service objects he 
> will retrieve
> > > > >>>from the lookup call. When the user have a generated service

> > > > >>>class binded in the JNDI, the endpoint URL of the 
> > Ports he might
> > > > >>>access are hardcoded! So I cannot change them ! (no
> > setEndpoint
> > > > >>>methods !).More, the generated Service class construct a new
> > > > >>>**SoapBinding for each <service>.get<PortName>()
call 
> > (with the
> > > > >>>hardcoded endpointURL :'( ).
> > > > >>>
> > > > >>>That why the only solution I find is to modify WSDL2Java!
> > > > >>>
> > > > >>>Regards
> > > > >>>Guillaume
> > > > >>>
> > > > >>>Davanum Srinivas wrote:
> > > > >>>
> > > > >>>>Guillaume,
> > > > >>>>
> > > > >>>>Am confused. Are you talking about the
> > **BindingStub.java class?
> > > > >>>>It's not needed on the server-side. It's used from a
> > client when
> > > > >>>>the client wants to invoke the service. That's the
> > > > >>>
> > > > >>>only
> > > > >>>
> > > > >>>>class that has a endpointURL param, note that
> > **BindingStub.java
> > > > >>>>classes have additional constructors where you can
> > pass in the
> > > > >>>>endpoint url as well.
> > > > >>>>
> > > > >>>>Thanks,
> > > > >>>>-- dims
> > > > >>>>
> > > > >>>>--- Guillaume Sauthier <Guillaume.Sauthier@Bull.Net>
wrote:
> > > > >>>>
> > > > >>>>>Hello all
> > > > >>>>>
> > > > >>>>>Maybe I don't post this question at the right place
> > but nobody
> > > > >>>>>on axis-users list answer me. And I thinks that's

> a question
> > > > >>>>>that might be interresting for the ones who are 
> > trying to use
> > > > >>>>>Axis in a J2EE compliant way.
> > > > >>>>>
> > > > >>>>>The problem is the following :
> > > > >>>>>In order to integrate Axis in JOnAS (OpenSource J2EE
> > > > >>>>>Application Server), we have to follow the 
> > JSR109/921. In this
> > > > >>>>>spec, they add a new element in servlet and ejb
> > Deployment Desc
> > > > >>>>>(the component that can be WebServices client) :
> > service-ref.
> > > > >>>>>This element describe the port that the component
will use
> > > > >>>>>(with port-component-ref element). And the 
> > port-component-ref
> > > > >>>>>can specify a port-component-link, That just say
> > that the port
> > > > >>>>>used by the client is contained in the same 
> application unit
> > > > >>>>>(ear file). So the URL location of this port is 
> > unknown when we
> > > > >>>>>generate the Service implementation from WSDL (the
> > Definition
> > > > >>>>>with a dummy location attribute) and so we have to
> > specify it
> > > > >>>>>when deploying in the server (we can then calculate
> > the URL of
> > > > >>>>>the port).
> > > > >>>>>
> > > > >>>>>That's for the context :) Now, how things works ?
When we 
> > > > >>>>>generate Class from WSDL, Service class are
> > generated
> > > > >>>>>with the endpointURL of the WSDL (dummy value). And
when we
> > > > >>>>>request a port with this Service class, this 
> endpointURL is 
> > > > >>>>>always used, and we have no way to change it (no 
> > accessor, more
> > > > >>>>>the endpointURL field is final!).
> > > > >>>>>
> > > > >>>>>Is there a correct way to tell the Service class to
> > use another
> > > > >>>>>endpoint value (the updated one, computed at time
of the
> > > > >>>>>endpoint deployment on the Application Server)?
> > > > >>>>>
> > > > >>>>>The easiest way I found is to change the WSDL2Java
tool for
> > > > >>>>>removing the "final" attribute of the endpointURL

> and add a 
> > > > >>>>>setEndpointURL(QName port, URL newURL) for replacing
the 
> > > > >>>>>endpoint value.
> > > > >>>>>
> > > > >>>>>I will be pleased to read your point of view on this
> > question.
> > > > >>>>>
> > > > >>>>>Regards
> > > > >>>>>
> > > > >>>>>Guillaume
> > > > >>>>
> > > > >>>>=====
> > > > >>>>Davanum Srinivas - http://webservices.apache.org/~dims/
> > > > >>
> > > > >>=====
> > > > >>Davanum Srinivas - http://webservices.apache.org/~dims/
> > 
> 


Mime
View raw message