Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SOAP Interface to EJB  RSS feed

 
Pearlo Muthukumaran
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have following doubts regarding SOAP:
1. If methods of EJBs (eg. SLSB) are accessed through SOAP APIs, are the calls invoked through Reflection API? Because the soap message contains the string of the method name....
2. Is that the reason why SOAP based method invocation has bad response times? (Due to Reflection Overheads)
Regards
Muthu
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pearlo Muthukumaran:
I have following doubts regarding SOAP:
1. If methods of EJBs (eg. SLSB) are accessed through SOAP APIs, are the calls invoked through Reflection API? Because the soap message contains the string of the method name....

I would say the use of reflection would be dependent on the actual implementation. Though it would seem reasonable to use reflection in this scenario.
Originally posted by Pearlo Muthukumaran:
2. Is that the reason why SOAP based method invocation has bad response times? (Due to Reflection Overheads)

No way! There is alot more that goes into SOAP calls then reflection. Performance of reflection in Java has come a long way and is not typically a problem today. The real dog in this scenario is twofold:
  • Every SOAP call is a remote call. Therefore you will have the extra network latency associated with any remote call.
  • The XML marshalling and unmarshalling that goes on in every SOAP call is time consuming. The same can be said about many RMI calls, a lot of time is wasted just serializing and deserializing parameters and return values.


  • [ June 11, 2003: Message edited by: Chris Mathews ]
     
    Pearlo Muthukumaran
    Ranch Hand
    Posts: 79
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Chris,
    Thank you for the reply, actually my scenario is
    to implement a callback mechanism without binding the methods to an interface and implement the same. Therefore :
    1. Can we invoke methodname of a SLSB or SFSB through Reflection API?
    2. Will there be any performance compromise by deploying this scenario?
    Of course I can use Command Pattern for this by creating a Command for possible actions to be taken when the called methods return to the caller. But there are about 25 different actions to be taken by the caller which means I will have to create 25 Commands with execute() method implementation which seems not to be a viable solution.
    This is the reason why I am eying on Reflection API usage.
    Please suggest your ideas
    Rgds
    Muthu
     
    Stan James
    (instanceof Sidekick)
    Ranch Hand
    Posts: 8791
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Reflection opens up some interesting possibilities. Could I call any session bean in your system just by knowing its name? Guess that was true anyway since they support remote calls.
    Take a look at Glue from TheMindElectric.com. You can publish any vanilla Java (not EJB) class as a SOAP service in a couple lines of code with the free version. Might have to go to the pro version to publish EJBs.
     
    Pearlo Muthukumaran
    Ranch Hand
    Posts: 79
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi,
    My clarification was mainly to know if the SOAP implementations use Reflection API. I DO NOT WANT to use SOAP because.
    1. Already, the EJB calls undergo the load of RMI/IIOP and above it SOAP will be a overkill
    2. I want to have the mechanism explained in my last posting of the same topic, within the
    Bean-to-Bean communication scope (of course I will have RMI/IIOP overhead but that alone)
    3. Domain of the application places performance as the top-most product quality attribute and modifiability with minimal rework as second
    Rgds
    Muthu
     
    Stan James
    (instanceof Sidekick)
    Ranch Hand
    Posts: 8791
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yeah, I'd be reluctant to use SOAP in front of EJB because you are essentially "remoting" twice. Then again, WebSphere now has "local" EJB calls with much lower overhead. Is that a J2EE standard thing or an IBM extension?
    But I might use SOAP and EJB as two mutually exclusive ways for remote clients to get to a server, and then execute the same POJO under the covers. SOAP has the advantage of being the lowest common denominator - almost any language and platform can call it. EJB has the advantage of being more efficient for Java clients.
    Of course my POJO would have the disadvantage of not using any EJB services. Ah, the tradeoffs never end.
     
    Pearlo Muthukumaran
    Ranch Hand
    Posts: 79
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    hi ,
    Local Interfaces are ejb specs and they are recommended if your underlying resources (Databases) are in the same system as that of your EJB components.

    Mainly this was introduced following the hue and cry of Entity Bean users wherein even if the DB is in the same system as that of Beans, Remote Call overheads were still there as per erstwhile EJB specs....
    Hope this helps..
    Rgds
    Muthu
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!