简体   繁体   中英

Get request address of XMLRpcRequest

I have the following code

public Object execute(XmlRpcRequest xmlRpcRequest) throws XmlRpcException { 

I want to get the ip address of the request, but this class doesn't offer this. It doesn't have a methode named getHostAddress() or something like that. Is there a way to archieve this?

You need to have a look at the type returned by the getConfig method. This says it returns an interface of type XmlRequestConfig but the actual type returned will depend on the underlying transport used. If you are using the correct transport then the underlying config class should have a method to get the host name or server url.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM