You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Robert Dietrick <rd...@sega.com> on 2002/06/21 02:14:42 UTC

SOAPContext parameter

I just upgraded to Tomcat 4.0.1 from 3.2.1.  Under the old version, I
could make RPC calls to methods with a first parameter SOAPContext as if
that parameter wasn't in the method signature.  Under the new version,
this isn't working.  The method signature resolution is failing.

In other words, my SOAP service has a method:
public String foo(SOAPContext soapCtx, String s) {
}

And my call to foo() passes one parameter: a String, s.  The method
resolution used to work, alla this feature mentioned in the docs:
If a service method with a matching signature is not found, a second
search is done for a method with an additional (first) parameter of type
SOAPContext. 

But now it fails.  The error is:
Exception in thread "main" java.lang.NumberFormatException: Exception
while hand
ling service request: swan.ac.ACSoapServer.foo(java.lang.String) -- no
signature
 match

If I remove the SOAPContext parameter, it works.  However, I need
information about the servlet container from the context.

Anyone else run into this?  

-rob

Re: Again: Getting IP and Port from Soap-http-Connection serverside

Posted by Oliver Rettig <Ol...@orat.de>.
Hallo,

thanks for your help. But I really need the remote client port. 

> can tell you how to do this with RPC style communication.

>You need to get a reference to the HttpServletRequest to find this
>information.  To do this, your handler method on the server needs to
>have a SOAPContext as the first parameter, which you will ignore from a
>client standpoint.  (The docs regarding this can be found under the
>"Getting at 'environmental' information for RPC style services" section
>here http://xml.apache.org/soap/docs/guide/migration.html.)  Finding out
>this information from the request is done as follows:
>
>public void someServerMethod(SOAPContext soapCtx, String param1, String
>param2) {
>        HttpServletRequest req = 
>         
>(HttpServletRequest)(soapCtx.getProperty(org.apache.soap.Constants.BAG_HTTPSERVLETREQUEST
>));
>         String remoteAddr = req.getRemoteHost();
>         int serverPort = req.getServerPort();
>         ...
>}
>
>The remote (client) port is not determinable.  I believe this will only
>work with Apache SOAP.

Your are right. If I use my MS-Soap-Client it fails.

So I am again searing for a solution.

Does anybody has further ideas?

best regards

Oliver

-- 
Oliver Rettig
Lachnerstr. 6
76131 Karlsruhe

ORAT Software-Entwicklung
www.orat.de
Steinstr. 23, 76131 Karlsruhe
Tel.: 0721/38489600

--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Again: Getting IP and Port from Soap-http-Connection serverside

Posted by Oliver Rettig <Ol...@orat.de>.
Hallo,

thanks for your help. But I really need the remote client port. 

> can tell you how to do this with RPC style communication.

>You need to get a reference to the HttpServletRequest to find this
>information.  To do this, your handler method on the server needs to
>have a SOAPContext as the first parameter, which you will ignore from a
>client standpoint.  (The docs regarding this can be found under the
>"Getting at 'environmental' information for RPC style services" section
>here http://xml.apache.org/soap/docs/guide/migration.html.)  Finding out
>this information from the request is done as follows:
>
>public void someServerMethod(SOAPContext soapCtx, String param1, String
>param2) {
>        HttpServletRequest req = 
>         
>(HttpServletRequest)(soapCtx.getProperty(org.apache.soap.Constants.BAG_HTTPSERVLETREQUEST
>));
>         String remoteAddr = req.getRemoteHost();
>         int serverPort = req.getServerPort();
>         ...
>}
>
>The remote (client) port is not determinable.  I believe this will only
>work with Apache SOAP.

Your are right. If I use my MS-Soap-Client it fails.

So I am again searing for a solution.

Does anybody has further ideas?

best regards

Oliver

-- 
Oliver Rettig
Lachnerstr. 6
76131 Karlsruhe

ORAT Software-Entwicklung
www.orat.de
Steinstr. 23, 76131 Karlsruhe
Tel.: 0721/38489600