如何将调用者IP添加到webget UriTemplate参数

时间:2015-05-20 07:40:02

标签: c# web-services wcf rest

我找不到添加到web获取uri模板参数的方法。

我正在使用RESTful服务,我需要在GET操作中添加调用者IP,以便在我的界面实现中使用。

我希望有一个关键字用于此目的,例如“context.Request.UserHostAddress”,并且以下属性可以工作:

[WebGet(UriTemplate = "?{context.Request.UserHostAddress})]

1 个答案:

答案 0 :(得分:0)

找到它了!

您需要在实施中添加以下内容:

mongodb start/running, process 15259
Can't exec "/sbin/insserv": No such file or directory at /usr/sbin/update-rc.d line 382.
update-rc.d: error: insserv rejected the script header
No apport report written because the error message indicates its a followup error from a previous failure.
                          dpkg: error processing package mongodb-server (--configure):
 subprocess installed post-installation script returned error exit status 255
dpkg: dependency problems prevent configuration of mongodb:
 mongodb depends on mongodb-server (>= 1:2.4.1-2); however:
  Package mongodb-server is not configured yet.

dpkg: error processing package mongodb (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
 postfix
 mongodb-server
 mongodb
E: Sub-process /usr/bin/dpkg returned an error code (1)