Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/367.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在spring boot项目中配置RestClientProxyFactoryBean_Java_Spring - Fatal编程技术网

Java 如何在spring boot项目中配置RestClientProxyFactoryBean

Java 如何在spring boot项目中配置RestClientProxyFactoryBean,java,spring,Java,Spring,请帮忙。如何在spring boot项目中配置RestClientProxyFactoryBean Thx请参见此示例:它创建了一个rest客户端服务,您可以调用该服务来获取rest客户端实例以进行http调用 可在以下链接中查看此功能的用法: 下面可以找到一些要运行的测试用例: 说明: 因此,基本上我们可以使用ProxyFactorybean创建不同的RESTClient。在上面的示例中,正在创建名为Geoplanetservice的服务。Rest通信通过GeoPlanetClient服

请帮忙。如何在spring boot项目中配置RestClientProxyFactoryBean


Thx

请参见此示例:它创建了一个rest客户端服务,您可以调用该服务来获取rest客户端实例以进行http调用

可在以下链接中查看此功能的用法:

下面可以找到一些要运行的测试用例:

说明:


因此,基本上我们可以使用ProxyFactorybean创建不同的RESTClient。在上面的示例中,正在创建名为Geoplanetservice的服务。Rest通信通过GeoPlanetClient服务接口进行,该接口通过我们的proxyfactory bean实例化。

coo。Thx人!但只有一个问题。什么是ServiceInterface?它正在factory对象中设置。是我们必须创建的自定义类还是可以提供默认类?@Pavan更新了答案。如果您要查看示例目录,请在测试目录中签出GeoPlanet服务及其testcase。这应该是不言自明的。如果这个答案有助于你否决投票,那么一定要接受它:我本想亲自看看这个解决方案,但链接断了。我想这就是为什么他们说不要给出一个只包含链接的答案?