Thank you Scott! That's what I want. We are using messaging API.
Actually I am looking at the SOAPContext class, but I didn't find method
to getRemoteAddr/getRemoteHost directly and I don't the trick to use
getProperty(Constants.BAG_HTTPSERVLETREQUEST).
Daniel
Scott Nichol wrote:
You will need to access the SOAPContext for the request. This allows you to access
the HttpServletRequest, on which the getRemoteAddr or getRemoteHost method will give
you what you need.
Does your service use the RPC or messaging API? For the messaging API, you get the
SOAPContext for the request passed into your service method. For the RPC API, you
need to use a trick: add SOAPContext as the first parameter to your method. For
example, if your method is
String foo(String bar, int baz)
change it to
String foo(SOAPContext req, String bar, int baz)
Now that you have the SOAPContext, use the getProperty method with the parameter
Constants.BAG_HTTPSERVLETREQUEST, i.e.
HttpServletRequest hsr = req.getProperty(Constants.BAG_HTTPSERVLETREQUEST);
This is documented in the User Guide
(http://ws.apache.org/soap/docs/guide/migration.html).
Scott Nichol
Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message -----
From: "Daniel Zhang" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 25, 2004 2:30 PM
Subject: SOAP method to get server/ip of incoming message source
Hi, All:
In SOAP package, is there any method could retrieve servername/IP of
incoming source? I need a method sitting on the server side to tell the
client servername or IP.
Thanks,
Daniel