简体   繁体   English

获取XMLRpcRequest的请求地址

[英]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. 我想获取请求的IP地址,但是此类不提供此地址。 It doesn't have a methode named getHostAddress() or something like that. 它没有名为getHostAddress()的方法或类似的方法。 Is there a way to archieve this? 有办法存档吗?

You need to have a look at the type returned by the getConfig method. 您需要查看getConfig方法返回的类型。 This says it returns an interface of type XmlRequestConfig but the actual type returned will depend on the underlying transport used. 这表示它返回了XmlRequestConfig类型的接口,但是返回的实际类型将取决于所使用的基础传输。 If you are using the correct transport then the underlying config class should have a method to get the host name or server url. 如果使用正确的传输方式,则基础配置类应具有一种获取主机名或服务器URL的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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