Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SOAP Engine  RSS feed

 
Kiran Kumar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to incorporate some caching logic into the Apache SOAP Engine. That is, I am trying to modify RPCRouterServlet.java, RPCJavaProvider.java and RPCRouter.java to enable caching of frequest responses of the servlet.
This is the scenario that I guess happens
1. RPCRouterServlet receives the request from the client. (doGet(..) method is called)
2. RPCRouterServlet will make RPCJavaProvider as the 'provider' and does...
2.1. locate(..) will check the availability of the web service and then sets the TargetObjectURI.
2.2. when there is no SOAPException thrown by locate(), invoke() is called.
3. invoke(..) in RPCJavaProvider will call RPCRouter.invoke() to actually make method call to the web service by passing parameters.
My question is
1. How is the Response object from RPCJavaProvider.invoke() is sent back to RPCRouterServlet.
The question arises because, RPCJavaProvider.invoke(..) doesn't return anything when it is called by RPCRouterServlet.doGet(..). So, how is RPCRouterServlet able to send Response to the Client?

I know its a little lousy to understand
Regards,
Kiran
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The RPCJavaProvider modifies the "response" SOAPContext object given as a parameter to it. After the provider has finished, the RPCRouterServlet creates a TransportMessage instance based on the SOAPContext and asks the TransportMessage instance to write itself into the HTTP response stream. For doing this, TransportMessage relies on the SOAPContext.
 
Kiran Kumar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I still have some questions
1. RPCJavaProvider, as you said, modifies the "response" SOAPContext given as parameter to it by the RPCRouterServlet. But, how does RPCJavaProvider return this "response" back to RPCRouterServlet? considering, RPCJavaProvider.invoke() doesn't return anything.
My guess is: RPCJavaProvider.invoke() always throws SOAPExceptions which are caught by RPCRouterServlet.doGet() even for a smooth running call. Am I correct?
2. This is question is in different context. Are RPCRouterServlet,RPCRouter and RPCJavaProvider persistent? Because, I want to create a Hashtable inside RPCRouter and I'm not sure if that will be persistent as long as the Tomcat server is up.
3. This is regarding Tomcat Container. Does Tomcat have a log for each class that is invoked when it is up? If yes, where does this log reside in? (which directory?)
Thanks,
Kiran
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. RPCJavaProvider, as you said, modifies the "response" SOAPContext given as parameter to it by the RPCRouterServlet. But, how does RPCJavaProvider return this "response" back to RPCRouterServlet? considering, RPCJavaProvider.invoke() doesn't return anything.
My guess is: RPCJavaProvider.invoke() always throws SOAPExceptions which are caught by RPCRouterServlet.doGet() even for a smooth running call. Am I correct?
No, the response object is not returned to anyone. But since the response object is being referred to by both RPCJavaProvider and RPCRouterServlet, all modifications made by one are visible to the other.
2. This is question is in different context. Are RPCRouterServlet,RPCRouter and RPCJavaProvider persistent? Because, I want to create a Hashtable inside RPCRouter and I'm not sure if that will be persistent as long as the Tomcat server is up.
I don't have the source code for Apache SOAP handy right now, but I'd bet that the provider is not persistent. If I remember correctly, the servlet creates a new provider instance for each incoming request.
3. This is regarding Tomcat Container. Does Tomcat have a log for each class that is invoked when it is up? If yes, where does this log reside in? (which directory?)
I don't think there is such a log. You can add such logging calls to Tomcat sources yourself, of course. For example, using AspectJ.
 
Kiran Kumar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right Lesse! Provider is not persistent. RPCRouterServlet will create a new one after deciding which one to create, JavaProvider or Custom etc. But, do you think RPCRouter is persistent, because it is used by every Provider. I can send you the 3 java files if I can get your email address.
Thanks,
Kiran
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't send me anything. I'll take a look at it tomorrow if I have time. It's to bed with me now...
 
Kiran Kumar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lasse,
I found out that RPCRouter is persistent through the uptime of Tomcat.
Thanks for your time,
Kiran
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. No problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!