Open dongweifly opened 2 years ago
go client 调用java provider
go version
dubbo.apache.org/dubbo-go/v3 v3.0.0 github.com/apache/dubbo-go-hessian2 v1.10.0 github.com/dubbogo/grpc-go v1.42.6-tripl
java version
<groupId>org.apache.dubbo</groupId> <artifactId>dubbo</artifactId> <version>2.7.3.5-ext</version>
RiskServerResponse<RiskCommonRes> riskEntry(RiskCommonJsonReq req);
调用参数,使用fastJson的JSONObject
public class RiskCommonJsonReq implements Serializable { private JSONObject commonParams; private JSONObject bizParams; .... }
resp, err := refConf.GetRPCService().(*generic.GenericService).Invoke( context.TODO(), "riskEntry", []string{"common.model.RiskCommonJsonReq"}, []hessian.Object{ map[string]hessian.Object{ "bizParams": map[string]hessian.Object{ "texts": []hessian.Object{ // 想反序列化得到一个arrayList的对象 "微信15245671890", }, }, "commonParams": map[string]hessian.Object{ "code": "SHOP_INFO_NICKNAME", "ip": "1.2.3.4", "userId": "12345", }, }, }, )
如果text 写成[]string, JAVA 端那么序列化出来的类型,String[] 如果text写[]hessian.object,那么JAVA反序列出来的类型Object[], 都不满足服务端的解析要求; 能否提供对arrayList的类型声明支持,或有其他实现路径?
cc @sanxun0325
use []*string , such as:
ss:="微信15245671890" "texts"=[]*string{&ss}
@dongweifly 如果按照 @sanxun0325 的方法使用后,还有问题,请回复。
go client 调用java provider
Version
go version
java version
服务端接口声明
RiskServerResponse<RiskCommonRes> riskEntry(RiskCommonJsonReq req);
调用参数,使用fastJson的JSONObject
GO调用代码
如果text 写成[]string, JAVA 端那么序列化出来的类型,String[] 如果text写[]hessian.object,那么JAVA反序列出来的类型Object[], 都不满足服务端的解析要求; 能否提供对arrayList的类型声明支持,或有其他实现路径?