このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
.NET クライアントのプログラミング
MATLAB® Production Server™ .NET クライアント API を使用すると、ネイティブな .NET データを使用してリモート サーバー上で MATLAB 関数を評価できます。.NET クライアント API は、クライアント/サーバー通信に次の 2 つのワークフローを提供します。
一方のワークフローは、サーバーにデプロイされた MATLAB 関数の評価時に、リクエスト作成とデータ シリアル化の実装詳細を非表示にします。このワークフローは MWHttpClient
クラスを使用し、MATLAB 関数を評価する次の 2 つのスタイルの API から選択できます。
静的プロキシ — MATLAB 関数のシグネチャをモデル化するインターフェイスを提供します。これは、コンパイル時に適切なデータ型を関数に渡すことを強制するタイプ セーフな API です。
動的プロキシ — 関数名をパラメーターとして関数の引数と共にプロキシに渡します。これにより、実行時まで型の確認が延期されます。
もう一方のワークフローは、リクエスト作成のための MATLAB 関数実行およびデータ シリアル化のための "プロトコル バッファー" (protobuf) に MATLAB Production Server MATLAB 関数実行のための RESTful API を使用します。プロトコル バッファーは、構造化データをシリアル化する、言語に依存せずかつプラットフォームに依存しない手法です。MATLAB Production Server .NET クライアント ライブラリは、protobuf メッセージの作成と protobuf レスポンスの逆シリアル化を、内部で実行するためのヘルパー クラスを提供します。
オンプレミスの MATLAB Production Server インストールでは、クライアント API は
にあります。ここで、$MPS_INSTALL
/client
は MATLAB Production Server のインストール場所です。クライアント API は、MATLAB Production Server Client Libraries でダウンロードすることもできます。また、Java® クライアント API は Maven™ リポジトリ (https://mvnrepository.com/artifact/com.mathworks.prodserver/mps_java_client) にホストされます。$MPS_INSTALL
トピック
基礎
- Microsoft Visual Studio 環境の準備
MATLAB Production Server .NET クライアント ライブラリを使用するために Microsoft® Visual Studio® 環境をセットアップする。 - Create a .NET MATLAB Production Server Client
Learn how to create a .NET MATLAB Production Server client.
静的プロキシと動的プロキシを使用したプログラミング
- C# クライアントの作成
MATLAB Production Server にデプロイされた MATLAB 関数を C# アプリケーションから呼び出す方法を学習する。 - Invoke MATLAB Functions Dynamically
Invoke functions on the server without creating a proxy. - Configure the Client-Server Connection
Configure the timeout and response size limits for a client. - .NET Client Coding Best Practices
Best practices for writing .NET client code that invokes MATLAB code.
データ シリアル化のための RESTful API およびプロトコル バッファーを使用したプログラミング
- Asynchronous RESTful Requests Using Protocol Buffers in .NET Client
Example that shows how to make asynchronous RESTful requests using protocol buffers in a C# client. - Synchronous RESTful Requests Using Protocol Buffers in .NET Client
Example that shows how to make synchronous RESTful requests using protocol buffers in a C# client. - Struct Support for RESTful Requests Using Protocol Buffers in .NET Client
Example that shows the support for structs as input for RESTful requests using protocol buffers in a C# client.
入力と出力
- Code Multiple Outputs for C# .NET Client
Learn how to allow multiple outputs in a C# function when integrating MATLAB functions with multiple outputs. - Code Variable-Length Inputs and Outputs for .NET Client
Allow variable number of input and output arguments in a .NET client application.
セキュリティ
- Execute MATLAB Functions Using HTTPS
Configure the server and client environment to use SSL, then create a program proxy using the URL of the deployed application.
データ型とデータ変換
- Marshal MATLAB Structures (structs) in C#
Integrate MATLAB code that contains structures in a C# application. - クライアントとサーバーのマーシャリングでサポートされている MATLAB データ型
MATLAB Production Server は、クライアント アプリケーションとサーバー インスタンス間で複数の MATLAB データ型のマーシャリングをサポートする。 - Data Conversion with C# and MATLAB Types
Data type equivalents between MATLAB and C#. - MATLAB 型と C# 型の間の変換
MATLAB と C# の間で同等となるデータ型。