• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynamically publish webservice on different urls

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.

I have this scenario:

In a message exchange protocol, I need to expose the same Webservice through different URLs.

Suppose I've a webservice published on http//localhost/Webservice and http//localhost/Webservice2.

A user, through a configuration console, can add a new endpoint URL, and programmatically a new webservice instance has to be published to that URL to catch incoming messages.

Is there any way to accomplish this? I have a Glassfish 3 Application server and I'd like if the webservice expose could use the application context for transactional operation and so on.

Regards.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This sounds like a REST architecture where all requests go through a root servlet and get handled according to the remainder of the URL.

Bill
 
francesco umani
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The webservice exposed as to be a soap one accordingly to a standard fixed xsd and operation.
Depending on the invocated URL some parameters are detected.

EX. If I receive a message on http//localhost/Webservice I know that the invoker is invoker1 (simplifying).


 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

A user, through a configuration console, can add a new endpoint URL, and programmatically a new webservice instance has to be published to that URL to catch incoming messages.



So you want a client to be able to start an entirely new SOAP message handler at a new arbitrary address!

I would say it is time to drop back to the 10,000 meter view and go for a new architecture.

Bill
 
francesco umani
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William Brogden wrote:
So you want a client to be able to start an entirely new SOAP message handler at a new arbitrary address!



It's the specific .
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where does the code for this new SOAP message handler come from?

Bill
 
francesco umani
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In what a sense? In the current realization, a pojo read the configuration from a database and lunch a thread for each webservice exposing a new endpoint (the website is always the same, what is changing is only the webserver name and tcp port).
What i'd like to do is us an application server glassfish to do some similar, for example instantiating a new session bean for each endpoint.

Thanks again.

 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry if I am a little slow, but I am still trying to figure out what is different about these custom webservices that the client can request.

It sounds like a RESTful architecture because the URL designates a resource, but apparently the resource is a named SOAP message handler.

A "root" servlet that gets all requests could look at the URL and decide if it already knows this name - if so locate instance of the SOAP handler and forward the request and response objects. If it does not recognize the name, create a new instance (with some custom parameters?), remember the name and instance, and forward the request and response.

Bill
 
francesco umani
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No problem, It's me. My English is poor and I can't exlpain the problem very well, so thanks for the effort.

What I'm doing is:

1) read the configuration from a database (where the user enter the endpoints needed for accept incoming messages)
2) foreach endpoint needed, istantiate a new javax.xml.ws.Endpoint with Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, implementator);
implementor is a @WebService annotated java class corresponding to the wsdl I want to expose, initialized through an init(Configuration configurationFromPoint1)
3) publish the endpoint calling e.publish("DESIDERED URL READ FROM POINT 1)");
4) when the webservice receive a message (the client call the webservice) the webservice store the message and the parameters stored in configuration.

All this work but in a J2SE6 environment.
I'm wandering how to realize the same in a J2EE environment using JTA, JPA, EJBs and so on...

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic