FAQ

Updated at:

Common questions about Mobile Gateway Service, including packet size limits, call failures, API error codes, and SDK dependency conflicts.

Is there a limit on the gateway request packet size?

The gateway enforces a hard limit of 200 KB on both requests and responses. For reliable performance, keep packets under 2 KB. Larger packets degrade performance and stability.

The gateway is designed for Remote Procedure Call (RPC) data transmission, not large file transfers. For file uploads and downloads, use OSS, which is optimized for large data transfers.

How do I troubleshoot a failed call?

For troubleshooting guidance on error codes, connectivity issues, and payload errors, see Troubleshoot gateway errors.

What do the API error codes mean?

For a full list of error codes and their meanings, see Gateway result codes.

How do I resolve a conflict between OkHttp/okio and mPaaS when referencing OkHttp?

This conflict occurs because mPaaS bundles its own Wire component, which clashes with the OkHttp/Okio version your project requires. To fix it:

  1. Exclude the mPaaS Wire component by adding the following to your build configuration:

    mpaascomponents{
       excludeDependencies=['com.alipay.android.phone.thirdparty:wire-build']
    }
  2. Add the public Wire component as a direct dependency:

    implementation  'com.squareup.wire:wire-lite-runtime:1.5.3.4@jar'

How do I add parameters to the POST body when calling an MGS RPC interface with a JSAPI POST request?

After you configure the POST body and its data model in MGS, pass the POST body content as the value of _requestBody inside the requestData array. The _requestBody field is required and must be a JSON-encoded string, as shown in the following example:

window.onload = function() {
     ready(function() {
       window.AlipayJSBridge.call('rpc', {
         operationType: 'MYAPI',
         requestData: [
         {"_requestBody":"{\"key1\":\"value1\",\"key2\":\"value2\"}"}],
         headers:{},
         getResponse: true
       }, function(data) {
         alert(JSON.stringify(data));
       });
     });
   }