0

I built a web-service application in Jdeveloper 11.1.1.7 to be used by other clients. Simply the general steps as follow (Server web-service Application is built ---> Deployed on server ---> Used by clients through WSDL file location).

Now I come across a requirement where I need to get the client's IP address and port number.

Questions:

How to get IP address of the calling client to the web-service application built in Jdeveloper?

Common technologies used to built web-service applications is AXIS or CXF. What technology Jdeveloper use to built web service application ?

Salman
  • 1,236
  • 5
  • 30
  • 59

2 Answers2

1

This solution should work fine for you, it uses only the standard JAX-WS interface https://stackoverflow.com/a/12816220/1643498

I am not sure about the Web Service stack used in JDeveloper/Oracle ADF, this is most likely the WebLogic implementation of JAX-WS.

Community
  • 1
  • 1
Tomasz W
  • 2,263
  • 1
  • 17
  • 22
0

here is how I solve the problem based on @Tomaz Solution:

jax ws getting client ip

In Class:

 @Resource WebServiceContext wsContext;

In Web Method:

MessageContext msgx = wsContext.getMessageContext();
HttpServletRequest req = (HttpServletRequest)msgx.get(MessageContext.SERVLET_REQUEST);
String inCommingClientIpAddress=req.getRemoteAddr();

System.out.println("Client IP is: "+inCommingClientIpAddress
Community
  • 1
  • 1
Salman
  • 1,236
  • 5
  • 30
  • 59