MPS async mode throws error 5 return type not supported when invoked with .NET async REST/protobuf
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a function deployed to MPS that takes two input parameters (string, int) and returns a single string output. Its signature according to the discovery service reads in part:
"inputs":[{"help":"","mwsize":[],"mwtype":"string","name":"stringParam"},{"help":"","mwsize":[],"mwtype":"","name":"intParam"}],"outputs":[{"help":"error messages","mwsize":[],"mwtype":"string","name":"em"}]
This function is executable using the REST API; a request like:
{"nargout":1,"rhs":["some string value",12345],"outputFormat":{"mode":"large","nanInfFormat":"object"}}
results in successful execution.
My problem comes when trying to invoke this function using the .NET async REST+protobuf client. I send the same string and int inputs, but I get this message back (also logged in the server instance's main log):
5687 [2023.02.28 15:18:02.723250] [error] [async_request_id:b24be8bd-6044-4942-b2a9-80af8de2d84b] Request completed with error., code = 5, message = return type not supported
Maybe I don't understand how to construct the parameters properly to expect a return type of string. My request params are constructed like:
MATLABParams.Create(1, new List<Type> { typeof(string) }, "some string value", 12345);
POSTing those MATLABParams to the server results in successful creation of an async request handle; but like I said it triggers this "return type not supported" error.
What am I doing wrong here?
0 commentaires
Réponses (1)
Dheeraj
le 25 Sep 2023
Hi,
I understand you are encountering a code 5 error i.e. return type not supported when trying to invoke a REST endpoint through .NET async REST+protobuf client.
This might be because of how your .NET client is handling the return type. The client is unable to handle or process the return type of the function correctly.
Ensure that the return type of the MATLAB function you are invoking is compatible with the .NET async REST+protobuf client. It's important to verify that the client library you are using can handle string return types correctly with serialization and deserialization.
If this still results in an error, you could attach your client-side code so it is possible to debug.
Hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur .NET Client Programming dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!