You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by soap vamsi <so...@rediffmail.com> on 2002/04/22 08:21:33 UTC

Re: using SOAPContext as first argument in RPC SOAP messages class not working

CLARIFICATION NEEDED ...............
hello andrew,
How how do you expect this method to be invoked?
What is the exact signature of the method you invoke at the client 
end to test if this method will get invoked?
Thanks in advance
vamsi
On Fri, 19 Apr 2002 Andrew Trieger wrote :
>Hello,
>
>    I've checked the bugzilla bug database and the archives
>on this list and don't think this is a known problem, so I'm 
>describing
>it here to see if I'm an idiot or if its a real problem.
>
>    I soapv2.2 on linux (mandrake 8.1, kernel 2.4.x)
>running in both tomcat 4.x and iplanet 6.0SP2, each able to use 
>either
>jdk1.3.1_01 or jdk1.4.0.
>
>    I have 1 class with some methods I'm exposing using
>soap to RPC calls.
>
>    1 of those methods is a simple helloworld method
>that used to take 1 arg, a string, and just return it.  But now I 
>need
>to develop application level security so I need access to the 
>HTTPServletRequest
>object from the servlet.  In soapv2.2 (new, not in 2.1 so the 
>docs
>say) an apache-soap specific feature was added such that when 
>scanning
>a class for a method matching the signature requested by an 
>incoming request,
>if the signature isnt found, a second search is done with the 
>same signature
>but with an additional FIRST argument of type 
>org.apache.soap.rpc.SOAPContext.
>The idea being that this will then be invoked and you can ask 
>this object
>for different things from its grab-bag, thereby getting the 
>servlet request
>object and finding out stuff.
>
>    here's the code:
>
>
>
>  /** return the argument sent in, just to prove you
>
>   * can pass a string and get it back... ooo coool.
>
>   */
>
>  public String 
>helloWorldWithArg(org.apache.soap.rpc.SOAPContext
>ctx, String arg) {
>
>    HttpServletRequest req = null;
>
>    _log("i am in helloworldwitharg now, the one with
>ctx passed in.");
>
>    req = 
>(HttpServletRequest)ctx.getProperty(org.apache.soap.Constants.BAG_HTTPSERVLETREQUEST);
>
>    if (req != null) _log("remote user is: 
>"+req.getQueryString());
>
>    return arg;
>
>  }
>
>
>
>
>
>
>
>    Here's the problem:
>
>    It works fine in both java's and both webservers
>(iplanet and tomcat) if I do NOT have the SOAPContext first 
>argument
>there, only the String named "arg".  But, if i change the code 
>to
>as it appears above, recompile (with the proper javac for 
>whichever java
>i'm using) and restart the webserver (not changing the 
>deployment, i.e.
>not deleting and re-deploying in soap's admin interface, then the 
>client
>is returned this exception:
>
>A fault was generated: [Attributes={}] 
>[faultCode=SOAP-ENV:Server] [faultString=Exception
>while handling service request: org/apache/soap/rpc/SOAPContext] 
>[faultActorURI=/soap/servlet/rpcrouter]
>[DetailEntries=] [FaultEntries=]
>
>
>
>    And from println's in my code, my method is never
>called.
>
>    So my questions are:
>
>1. has anyone else gotten this new feature to work in a similar 
>environment
>to mine?
>
>2. Does anyone know how to get more debugging information out 
>server
>side to see why its not finding this method to call?  There are 
>no
>messages written to stdout.
>
>
>
>    Thank you for your time,
>
>    Drew Trieger
>
>    atrieger@yahoo.com
>
>
>
>--
>---
>
>

_________________________________________________________
Click below to visit monsterindia.com and review jobs in India or 
Abroad
http://monsterindia.rediff.com/jobs