|
Hi,
I tried to get the SOAP-Kontext within my
SOAP-service, but it didn't work. I get the following error
message:
Generated fault:
Fault Code = SOAP-ENV:Server Fault String = Exception while handling service request: org/apache/soap/rpc/SOAPContext Any idea?
Background: WinXP HOME; Apache 1.3.22; Apache
Tomcat 4.01; Apache SOAP 2.2
I used the example from the SOAP-FAQ. The service
method looks like this:
public String test(SOAPContext soapCtx,String name)
{
HttpServletRequest req = (HttpServletRequest)soapCtx.getProperty(org.apache.soap.Constants.BAG_HTTPSERVLETREQUEST); String remoteIPAddress = req.getRemoteAddr(); return(remoteIPAddress); } The client-side call looks like this:
// Build the
call.
Call call = new Call();
call.setTargetObjectURI("urn:ootest");
call.setMethodName("test"); Vector params = new Vector(); params.addElement(new
Parameter("name",
String.class,
"Michael", null)); // Invoke the
call.
Response resp; try
{ resp = call.invoke(url, ""); } catch (SOAPException e) { return("Caught SOAPException (" + e.getFaultCode() + "): " + e.getMessage()); } The original text of the faq:
How can I get the IP address of a client that
is using my SOAP Service? --------------------------------------------------------------------------------
Michael Timpe Melchiorstr. 24 50670 K�ln eMail: [EMAIL PROTECTED] |
