Windows Web サービスの例
次の例は、Windows Web サービス API の使用方法を示しています。
- サービス モデルの例
- TCP チャネル レイヤーの例
- HTTP チャネル レイヤーの例
- UDP チャネル レイヤーの例
- 名前付きパイプ チャネル レイヤーの例
- メッセージの例
- XML の例
- 非同期モデルの例
- セキュリティ チャネルレイヤーの例
- ファイル レプリケーションの例
サービス モデルの例
Calculator Service: Client: HttpCalculatorClientExample, Server: HttpCalculatorServiceExample.
SSL トランスポート セキュリティを備えた Calculator Service: Client: HttpCalculatorWithSslClientExample、Server: HttpCalculatorWithSslServiceExample。
Calculator Service with Username over SSL mixed-mode security: Client: HttpCalculatorWithUsernameOverSslClientExample, Server: HttpCalculatorWithUserNameOverSslServiceExample.
Kerberos over SSL 混合モード セキュリティを使用した Calculator Service: Client: HttpCalculatorWithKerberosOverSslClientExample, Server: HttpCalculatorWithKerberosOverSslServiceExample.
Purchase Order Service: Client: HttpPurchaseOrderClientExample, Server: HttpPurchaseOrderServiceExample.
SSL トランスポート セキュリティを備えた Purchase Order Service: Client: HttpPurchaseOrderWithSslClientExample、Server: HttpPurchaseOrderWithSslServiceExample。
SSL 混合モード セキュリティ上のユーザー名を持つ注文サービス: クライアント: HttpPurchaseOrderWithUsernameOverSslClientExample, Server: HttpPurchaseOrderWithUserNameOverSslServiceExample.
SSL 混合モード セキュリティ上の Kerberos を使用した注文サービス: クライアント: HttpPurchaseOrderWithKerberosOverSslClientExample 、サーバー: HttpPurchaseOrderWithKerberosOverSslServiceExample。
UnTyped Purchase Order Service: Server: UnTypedServiceExample. クライアント: UnTypedClientExample を する
セッションフル計算ツール: サーバー: SessionfullCalculatorServiceExample。 クライアント:SessionfullCalculatorClientExample。
カスタム チャネルとリスナー実装を使用した電卓: Server:HttpCalculatorWithLayeredChannelServiceExample。 クライアント: HttpCalculatorWithLayeredChannelClientExampleをします。
エンコードされたチャネルを使用する電卓: Server:HttpCalculatorWithEncodedChannelServiceExample。 クライアント: HttpCalculatorWithEncodedChannelClientExampleをします。
生の (SOAP 以外の) HTTP 要求を処理するサービス: Client:HttpRawClientExample。 サーバー: HttpRawServiceExampleをします。
サービス操作中止通知: サーバー: BlockingServiceExample 。 クライアント: ServiceCancellationExampleをします。
呼び出しの取り消し: サーバー: SessionfullCalculatorServiceExample。 クライアント: CallAbandonExampleをします。
ポリシーの説明を手動で作成し、それを使用してサービス プロキシを作成します。 PolicyTemplateExample。
TCP チャネル レイヤーの例
一方向のパターンを使用してメッセージを送信する TCP の例: Client: OneWayTcpClientExample、Server: OneWayTcpServerExample
要求/応答パターンを使用してメッセージを送信する TCP の例: Client: RequestReplyTcpClientExample、Server: RequestReplyTcpServerExample
ストリーミング TCP の例: Client: StreamingTcpClientExample、Server: StreamingTcpServerExample
非同期ストリーミング TCP の例: Client: AsyncStreamingTcpClientExample、Server: AsyncStreamingTcpServerExample
HTTP チャネル レイヤーの例
HTTP の例: Client: HttpClientExample、Server: HttpServerExample
ストリーミング API を使用する HTTP の例: Client: StreamingHttpClientExample、Server: StreamingHttpServerExample
UDP チャネル レイヤーの例
一方向のパターンを使用してメッセージを送信する UDP の例: Client: OneWayUdpClientExample、Server: OneWayUdpServerExample
マルチキャスト要求応答パターンを使用してメッセージを送信する UDP の例: Client: MulticastUdpClientExample、Server: MulticastUdpServerExample 次の例は同じですが、IPv6 アドレス指定を使用します。Client: MulticastUdpClientExample6、Server: MulticastUdpServerExample6
名前付きパイプ チャネル レイヤーの例
要求/応答パターンを使用してメッセージを送信する名前付きパイプの例: Client: RequestReplyNamedPipesClientExample、Server: RequestReplyNamedPipesServerExample
ストリーミングの名前付きパイプの例: Client: StreamingNamedPipesClientExample、Server: StreamingNamedPipesServerExample
メッセージの例
カスタム メッセージ ヘッダーを使用する例: CustomHeaderExample
メッセージをエンコードしてデコードする例: MessageEncodingExample
メッセージを転送する例: ForwardMessageExample
XML の例
ReadWriteXmlExample XML バッファーを使用して xml を書き込み、読み取る例
MTOM、WsWriteBytes、WsPushBytes、および WsPullBytes ReadWriteBytesXmlExample を使用してバイナリ データの書き込みと読み取りを行う例
NavigateXmlExample XML バッファー内を移動する例
ReadXmlExample ノードごとに XML ドキュメント ノードを読み取る例
ReadAttributeExample XML 属性を検索して表示する例
ReadWriteArrayExample 要素の配列を書き込んで読み取る例
InsertElementExample XML バッファーに要素を挿入する例
XmlBufferExample 一部の XML バッファー ヘルパー関数の使用を示す例
DerivedTypeExample wsutil によって生成されたヘルパー関数を使用して派生型を書き込み、読み取る例
非同期モデルの例
非同期関数のモデルを示す例。 AsyncModelExample の
セキュリティ チャネルレイヤーの例
TCP 経由の Windows トランスポート セキュリティ: クライアント: RequestReplyTcpClientWithWindowsTransportSecurityExample, Server: RequestReplyTcpServerWithWindowsTransportSecurityExample.
名前付きパイプ経由の Windows トランスポート セキュリティ: クライアント: RequestReplyNamedPipesClientWithWindowsTransportSecurityExample, Server: RequestReplyNamedPipesServerWithWindowsTransportSecurityExample.
SSL トランスポート セキュリティ: クライアント: HttpClientWithSslExample, Server: HttpServerWithSslExample.
SSL 混合モード セキュリティ上のユーザー名: クライアント: HttpClientWithUsernameOverSslExample, Server: HttpServerWithUsernameOverSslExample.
SSL 混合モード セキュリティ上のユーザー名: クライアント: httpClientWithKerberosOverSslExample 、Server: HttpServerWithKerberosOverSslExample。
メタデータの例
次の例は、エンドポイントがサポートするプロトコルに関する情報を抽出することを目的として、WSDL ドキュメントとポリシー ドキュメントを処理する方法を示しています。
SSL 混合モード セキュリティを介したユーザー名: MetadataImportWithUsernameOverSslExample。 SSL 混合モード セキュリティを介して発行されたトークン: MetadataImportWithIssuedTokenOverSslExample。 X509 証明書 over SSL mixed-mode security: MetadataImportWithX509OverSslExample.
WS-Metadata Exchange の例
次の例は、WS_SERVICE_HOSTで WS-MetadataExchange を有効にする方法を示しています。
WS-MetadataExchange が有効な TCP サービス: MetadataExchangeSample。 WS-MetadataExchange が有効になっている TCP サービスを呼び出す WCF サービス モニカー クライアント: ServiceMonikerSample 。
カスタム ヘッダーとサービス モデル
次の例では、WS_SERVICE_PROXY と WS_SERVICE_HOST でそれぞれカスタム ヘッダーを使用する方法を示します。
クライアント: HttpCustomHeaderPurchaseOrderClientExample, Server: HttpCustomHeaderPurchaseOrderServiceExample.
ファイル レプリケーションのサンプル
ファイル レプリケーション サービスを実装する方法を示す包括的なサンプル: Tool: FileRepToolExample、Service: FileRepServiceExample。
WCF パブリック サービスの相互運用
Windows Web サービス クライアントは、WCF サービス クライアントと通信します。wcfPublicServiceSample します。
カスタム HTTP プロキシ
Windows Web サービス クライアントは、カスタム プロキシ クライアントを使用して ASMX TerraService サービスと通信します。 Asmx TerraServiceSampleWithCustomProxy