You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/12/17 09:27:49 UTC

[GitHub] [dubbo-go] dongweifly opened a new issue #1673: 复杂类型中支持类型反序列化声明

dongweifly opened a new issue #1673:
URL: https://github.com/apache/dubbo-go/issues/1673


   go client 调用java provider
   ### Version
   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;
   ....
   }
   `
   
   ### GO调用代码
   
   `  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的类型声明支持,或有其他实现路径?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] LaurenceLiZhixin commented on issue #1673: 复杂类型中支持类型反序列化声明

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on issue #1673:
URL: https://github.com/apache/dubbo-go/issues/1673#issuecomment-999293625


   cc @sanxun0325 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org