0
有两种不同的GWT-RPC服务。如何从另一个rpc服务调用rpc服务方法?
TaxService
包含方法TaxDto getTax(ProductDto product);
ProductService
包含方法`双getTotalWithTax(ProductDto产品);
我想从getTotalWithTax()
打电话给getTax()
方法我该怎么做?
有两种不同的GWT-RPC服务。如何从另一个rpc服务调用rpc服务方法?
TaxService
包含方法TaxDto getTax(ProductDto product);
ProductService
包含方法`双getTotalWithTax(ProductDto产品);我想从getTotalWithTax()
打电话给getTax()
方法我该怎么做?
要在服务器端呼叫getTax()
,请创建TaxServiceImp
的实例,该实例可由getTotalWithTax(ProductDto product)
访问;从那里调用该方法。
public class ProductService Impl extends XsrfProtectedServiceServlet{
TaxServiceImp taxServImpInstance = new TaxServiceImp();
Double getTotalWithTax(ProductDto product){
TaxDto taxDtoInstance = taxServImpInstance.getTax();
//process your data and return what you need
return myDouble;
}
}