• Post Reply Bookmark Topic Watch Topic
  • New Topic

Client IP address cannot be read although injected Context.JwsContext annotation is not null.  RSS feed

 
oguz cavli
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am not able to get requester's client IP address in my web service implementation. I am using jws annotations.
Code snippet and result of its execution appended below.

Although JwsContext is injected successfully and returns the protocol (http-soap), jwsContext.getMessageContext() object does not contain much information.
My attempt to read the client IP address from always fails (returns NPE) because there is no such property inside my object. Only property I see is control.callback.context.path but I've no clue what that is.

I have also tried to inject @Resource (import javax.annotation.Resource) WebServiceContext (import javax.xml.ws.WebServiceContext) but it returns null in run-time.

I suspect I am injecting the wrong annotation but I am not able to find the correct one.

Environment: JDK 1.6, Weblogic 10.3


Result
 
oguz cavli
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I went through Weblogic documentation for JwsContex methods http://docs.oracle.com/cd/E13222_01/wls/docs103/webserv_rpc/jws.html#wp275419
It seems like there isn't any method available that returns client IP address. I guess being able to determine the protocol just fooled me.

I would be happy if you know the accurate annotation/method to retrieve request's IP address in jws webservice implementation running on Weblogic.

Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!