具有服务界面的Android休息请求

时间:2019-12-04 20:53:40

标签: android spring rest http request

在Spring中,创建休息服务的最佳做法如下。客户端和服务器都使用一个服务接口。

**服务器端。: **

<bean name="/servicename" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
        <property name="service" ref="serviceImplBean" />
        <property name="serviceInterface" value="serviceInterface"/>
    </bean>

**客户端: **

<bean id="service" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
        <property name="serviceInterface" value="serviceInterface" />
        <property name="serviceUrl" value="${service.url}" />
    </bean>

在春季至春季,这些产品运行良好。

  

我要问的是,从Android客户端请求服务的任何方法或库是什么?   更容易理解:HttpInvokerServiceExporter导出的端点是相同的服务(Spring)。还行吧。我有服务类的URL和服务的接口。像上述客户端示例一样,使用此接口从android向服务发出请求的任何方式。

感谢帮助。

0 个答案:

没有答案
相关问题