我正在使用WSRequest
类在我的Play网络应用程序中向外部Web服务发出请求。如何在New Relic的外部服务页面中监控外部请求?
下面的代码的小片段我使用进行SOAP调用:
WSRequest req = WS.url("http://mydomain.com/soap");
req.setHeader("Content-Type", "text/xml;charset=UTF-8");
Map<String, Object> args = new HashedMap();
args.put("countryCode", countryCode);
req.body(requestTemplate.render(args));
HttpResponse res = req.post();
Document document=null;
try{
document = res.getXml();
}catch(RuntimeException e){
System.out.println(res.getString());
throw e;
}
我想这个端点作出现身"External Services"页New Relic的对SOAP调用。我如何测试我的代码才能完成此任务?除了Ruby示例以外,我一直无法在文档中找到关于此的更多信息。
谢谢您的回答卢克。如果您能留下关于我可以在哪里提交功能请求票据的信息,那将非常棒。 –
用户无法提出功能请求,但可以代表您提供技术支持。只需访问support.newrelic.com并提出支持请求即可。 – llawson
哪个版本的CommonsHttp支持? 我们使用org.apache.httpcomponents的HttpClient 4.3.2,而不是看到外部服务从这里呼吁 注:https://hc.apache.org “HttpClient的是基于HTTP/1.1兼容HTTP代理实现它还为客户端身份验证,HTTP状态管理和HTTP连接管理提供可重用组件.HttpComponents Client是Commons HttpClient 3.x的继承者和替代者,强烈建议使用Commons HttpClient的用户进行升级。 – marstonstudio