nizhikov commented on a change in pull request #9490:
URL: https://github.com/apache/ignite/pull/9490#discussion_r757866994



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProxy.java
##########
@@ -317,7 +299,44 @@ private Object callServiceLocally(
             return ((PlatformService)svc).invokeMethod(methodName(mtd), false, 
true, args, callAttrs);
         }
         else
-            return mtd.invoke(svc, BinaryUtils.rawArrayInArgs(args, false));
+            return callServiceMethod(svc, mtd, args, callCtx);
+    }
+
+    /**
+     * @param svc Service to be called.
+     * @param mtd Method to call.
+     * @param args Method args.
+     * @param callCtx Service call context.
+     * @return Invocation result.
+     */
+    private static Object callServiceMethod(
+        Service svc,
+        Method mtd,
+        Object[] args,
+        @Nullable ServiceCallContext callCtx
+    ) throws InvocationTargetException, IllegalAccessException {
+        if (callCtx != null)
+            ServiceCallContextHolder.current(callCtx);
+
+        try {
+            return mtd.invoke(svc, args);
+        }
+        finally {
+            if (callCtx != null)
+                ServiceCallContextHolder.current(null);
+        }
+    }
+
+    /** */
+    private Object unmarshalResult(byte[] res) throws IgniteCheckedException {
+        Marshaller marsh = ctx.config().getMarshaller();
+
+        if (KEEP_BINARY.get() && BinaryArray.useBinaryArrays() && marsh 
instanceof BinaryMarshaller) {

Review comment:
       If we keep arrays in binary mode here then array component type will be 
lose.
   For the case when component type known on the server node.
   Because we read `Object[] {binaryobject}` from the stream instead of 
`UserObject[] {userObject}`.
   
   This case checked in .Net - `ServicesTest#TestCallJavaServiceRemote`:
   
   ```
               var bins = svc.testBinarizableArray(arr);
   
               Assert.AreEqual(typeof(PlatformComputeBinarizable[]), 
bins.GetType());
               Assert.AreEqual(new[] {11, 12, 13},bins.Select(x => x.Field));
   ```
   




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to