|
Marvellus!!! It works perfectly!!! I haven't
extended any Handler but I've copied the code into a method of the service
class, and it has discovered the correct address!!!
I have to thank you a lot: there are four days I'm
cooking my brain on this problem!!!
Thanks very much!
Vincenzo
----- Original Message -----
Sent: Thursday, July 03, 2003 5:55
PM
Subject: RE: Problem with web
services
Hi
Vincenzo,
I used a Handler to solve this
problem.
I
extended the BasicHandler to do this.... here's how I did
it.
**********************************************************************************
//package in here
import java.net.InetAddress;
import javax.servlet.http.HttpServletRequest;
import org.apache.axis.AxisFault;
import org.apache.axis.MessageContext;
import org.apache.axis.handlers.BasicHandler;
public class AuthHandler extends BasicHandler
{
public void invoke(MessageContext msgContext) throws AxisFault
{
try
{
HttpServletRequest req =
(HttpServletRequest)msgContext.getProperty( "transport.http.servletRequest");
String host = req.getRemoteHost();
String host2 = InetAddress.getByName(host).getHostName();
System.out.println( "host2 "+host2);
}
catch(
Exception exp )
{
System.out.println( "error");
throw AxisFault.makeFault( exp );
}
}
}
***********************************************************************************************
you
need to add a few lines to the deploy.wsdd
<requestFlow>
<handler type="java:(PACKAGE DESCRIPTION IN
HERE)AuthHandler"/>
</requestFlow>
make
sure they are inside the service and deployment
tags
Regards,
John
Hi all,
can anyone help me!?! My problem is
conceptually very simple, but "programmingly" not so easy... for my
experience. I'll explain my problem!!!
I'm developing a web service... a simple one,
just to understand some basical concepts, and I need to know the IP address
of the "client" side... better: I have the service on one PC, and from
another one I call the service. What I need is the IP address of the second
PC (the calling machine), but I'm not succeeding in find any method to
discover this address. Has someone of you some answer to my
question!?!
Thanks in advance
Vincenzo
|