aspose file tools*
The moose likes Web Services and the fly likes EJB End Point Design? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "EJB End Point Design?" Watch "EJB End Point Design?" New topic
Author

EJB End Point Design?

Mohamed Farouk
Ranch Hand

Joined: Jun 08, 2005
Posts: 249
Hello Friends
Please can you let me know what does a EJB End Point design mean. I have EJB component and company wants to make it as a Web Service. My understanding is just create a WSDL file based on the remote interface of the EJB component and package it accordingly so that any client can find it and JAX-RPC server runtime within the Container will do all the rest.
But when they say EJB End Point design do they mean I have to add another EJB to wrap my existing EJB to create a webservice endpoint? please explain.
Thanks


SCJP, SCWCD, SCBCD, SCEA 5
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41823
    
  63
The endpoint would at the least include a wrapper of the EJB in question. That wrapper should not be an EJB itself.

You will also need to decide which part of the EJB API you want to make available, and under which URL it will be accessible.

The endpoint also needs to handle security, i.e. authentication, authorization, encryption if desired, and so on. All of these are typically not part of an EJB, but declared outside ot it. You would need to add that to your endpoint.
[ October 20, 2005: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

The endpoint would at the least include a wrapper of the EJB in question. That wrapper should not be an EJB itself.


What wrapper are you talking about ? The web service interface which the EJB bean class implements.


Groovy
Mohamed Farouk
Ranch Hand

Joined: Jun 08, 2005
Posts: 249
Thanks for all your replies

<QUOTE>
The endpoint also needs to handle security, i.e. authentication, authorization, encryption if desired, and so on. All of these are typically not part of an EJB, but declared outside ot it. You would need to add that to your endpoint.
</QUOTE>


I understand all of this should be in the first point of contact of the request from the customer. But to call this NAME EJB End Point design is what is bit confusing. If this interface is not an ejb Itself but the funtionality is then it would be advisable to call endpoint interface rather than EJB End point interface? Am I thinking wrong.

As well If the end point interface is not EJB for an existing EJB business component can the same interface be reused with the web tier for non EJB's.

Can anyone comment?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41823
    
  63
The term "end point" is generally used for web services, not EJBs. So I'd think that an "EJB end point" is a web service end point for an EJB.

I see no reason why a web service end point should not be reused for something other than an EJB. If you encapsulate the EJB access in its own interface, you could have other implementations that do not use EJB.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

The end point interface is a just a plain remote interface. You could use the same interface for EJB or JSE in a web app.
Mohamed Farouk
Ranch Hand

Joined: Jun 08, 2005
Posts: 249
Thanks
So say I have a business functionality in EJB for which I write an java interface for webservice (END POINT) and then I have to the implementation for the same End point interface and the impl must now delegate all its requests to the EJB Business Functionality. This EP interface can handle any preprocessing validation and transformation of request from any client.

Now my question how will the container know that any request for webservice for an particular port has to go to this EP interface and Impl. Where is the binding specified?

With that I will conclude this topic I promise.
Thanks
Farouk
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by Mohamed Farouk:
Thanks
So say I have a business functionality in EJB for which I write an java interface for webservice (END POINT) and then I have to the implementation for the same End point interface and the impl must now delegate all its requests to the EJB Business Functionality. This EP interface can handle any preprocessing validation and transformation of request from any client.

Now my question how will the container know that any request for webservice for an particular port has to go to this EP interface and Impl. Where is the binding specified?

With that I will conclude this topic I promise.
Thanks
Farouk


You mention the service end point interface in ejb-jar.xml file. It is a plain remote interface and interface do not contain any code. There is no need for any delegation code because the container is going to call the bean class



Mohamed Farouk
Ranch Hand

Joined: Jun 08, 2005
Posts: 249
Soo where should I write all the preprocessing code if I dont have to do delegation manually.

Also Should any end point be extending remote?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by Mohamed Farouk:
Soo where should I write all the preprocessing code if I dont have to do delegation manually.

Also Should any end point be extending remote?


What pre-processing are you doing ? The container invokes the bean class directly when it receives the request. You could also look at MessageHandlers for pre-processing.
Mohamed Farouk
Ranch Hand

Joined: Jun 08, 2005
Posts: 249
Thanks for all your help
As a matter of End point design the recommendation was to couple all the validation, translation in the interaction layer which is the end point design. Now if the container takes it through through the end point interface to processing layer how can we implement all of this interactions
processing? Also should the end point interface extend remote always even for web tier end point?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by Mohamed Farouk:
Thanks for all your help
As a matter of End point design the recommendation was to couple all the validation, translation in the interaction layer which is the end point design. Now if the container takes it through through the end point interface to processing layer how can we implement all of this interactions
processing? Also should the end point interface extend remote always even for web tier end point?


Yes the end point interface must extend the Remote interface. Use message handlers for validation worK.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB End Point Design?