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

-----Original Message-----
From: Vincenzo Di Stefano [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 03, 2003 4:51 PM
To: [EMAIL PROTECTED]
Subject: Problem with web services

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

Reply via email to