Drew,

If Apache SOAP does not find a matching method, you
would get a "No such method" exception, which you do
not.  I believe you are getting a run-time exception
from your method.

One question that comes to mind: did you compile with
a servlet.jar that is compatible with Tomcat's?  If
your code expects an HttpServletRequest to look like
something different than it actually does at run-time,
you could get an error like the one you see.

Scott Nichol

--- Andrew Trieger <[EMAIL PROTECTED]> wrote:

<HR>
<!doctype html public "-//w3c//dtd html 4.0
transitional//en">
<html>
<body text="#000000" bgcolor="#FFFFFF" link="#0000FF"
vlink="#FF0000" alink="#000088">
Hello,
<p>&nbsp;&nbsp;&nbsp; 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.
<p>&nbsp;&nbsp;&nbsp; I&nbsp;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.
<p>&nbsp;&nbsp;&nbsp; I have 1 class with some methods
I'm exposing using
soap to RPC&nbsp;calls.
<br>&nbsp;&nbsp;&nbsp; 1 of those methods is a simple
helloworld method
that used to take 1 arg, a string, and just return
it.&nbsp; But now I&nbsp;need
to develop application level security so I need access
to the HTTPServletRequest
object from the servlet.&nbsp; 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&nbsp;argument of type
org.apache.soap.rpc.SOAPContext.&nbsp;
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.
<p>&nbsp;&nbsp;&nbsp; here's the code:
<br>&nbsp;
<p>&nbsp; /** return the argument sent in, just to
prove you
<br>&nbsp;&nbsp; * can pass a string and get it
back... ooo coool.
<br>&nbsp;&nbsp; */
<br>&nbsp; public String
helloWorldWithArg(org.apache.soap.rpc.SOAPContext
ctx, String arg) {
<br>&nbsp;&nbsp;&nbsp; HttpServletRequest req = null;
<p>&nbsp;&nbsp;&nbsp; _log("i am in helloworldwitharg
now, the one with
ctx passed in.");
<br>&nbsp;&nbsp;&nbsp; req =
(HttpServletRequest)ctx.getProperty(org.apache.soap.Constants.BAG_HTTPSERVLETREQUEST);
<br>&nbsp;&nbsp;&nbsp; if (req != null) _log("remote
user is: "+req.getQueryString());
<br>&nbsp;&nbsp;&nbsp; return arg;
<br>&nbsp; }
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;
<p>&nbsp;&nbsp;&nbsp; Here's the problem:
<br>&nbsp;&nbsp;&nbsp; It works fine in both java's
and both webservers
(iplanet and tomcat) if I&nbsp;do NOT&nbsp;have the
SOAPContext first argument
there, only the String named "arg".&nbsp; 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:
<p>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=]
<br>&nbsp;
<p>&nbsp;&nbsp;&nbsp; And from println's in my code,
my method is never
called.
<p>&nbsp;&nbsp;&nbsp; So my questions are:
<p>1. has anyone else gotten this new feature to work
in a similar environment
to mine?
<br>2. Does anyone know how to get more debugging
information out server
side to see why its not finding this method to
call?&nbsp; There are no
messages written to stdout.
<br>&nbsp;
<p>&nbsp;&nbsp;&nbsp; Thank you for your time,
<br>&nbsp;&nbsp;&nbsp; Drew Trieger
<br>&nbsp;&nbsp;&nbsp; [EMAIL PROTECTED]
<br>&nbsp;
<pre>--&nbsp;
---</pre>
&nbsp;
</body>
</html>



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

Reply via email to