WebClientProtocol.RequestEncoding プロパティ
アセンブリ: System.Web.Services (system.web.services.dll 内)

Dim instance As WebClientProtocol Dim value As Encoding value = instance.RequestEncoding instance.RequestEncoding = value
/** @property */ public Encoding get_RequestEncoding () /** @property */ public void set_RequestEncoding (Encoding value)
public function get RequestEncoding () : Encoding public function set RequestEncoding (value : Encoding)
クライアントによる要求に使用する文字エンコーディング。既定値は null 参照 (Visual Basic では Nothing) で、基になるトランスポートとプロトコルに既定のエンコーディングが使用されます。

RequestEncoding は、要求メッセージのエンコーディングを決定します。要求の ContentType に、エンコーディング値が追加されます。
WebClientProtocol から派生したクラスは、SoapHttpClientProtocol が SOAP をサポートするように特定のプロトコルをサポートし、そのプロパティのエンコード要件を満たす値をこのプロパティに設定します。たとえば、SoapHttpClientProtocol は既定のエンコーディングを UTF-8 に設定します。

XML Web サービス (Math) を呼び出す ASP.NET Web フォームの例を次に示します。この Web フォームでは、EnterBtn_Click 関数の中で、RequestEncoding を UTF-8 に明示的に設定します。
<html> <script language="VB" runat="server"> Sub EnterBtn_Click(Src As Object, E As EventArgs) Dim math As New MyMath.Math() ' Set the Content Type to UTF-8. math.RequestEncoding = System.Text.Encoding.UTF8 Dim iTotal As Integer = math.Add(Convert.ToInt32(Num1.Text), Convert.ToInt32(Num2.Text)) Total.Text = "Total: " & iTotal.ToString() End Sub </script> <body> <form action="MathClient.aspx" runat=server> Enter the two numbers you want to add and then press the Total button. <p> Number 1: <asp:textbox id="Num1" runat=server/> + Number 2: <asp:textbox id="Num2" runat=server/> = <asp:button text="Total" Onclick="EnterBtn_Click" runat=server/> <p> <asp:label id="Total" runat=server/> </form> </body> </html>
<html> <script language="C#" runat="server"> void EnterBtn_Click(Object Src, EventArgs E) { MyMath.Math math = new MyMath.Math(); // Set the Content Type to UTF-8. math.RequestEncoding = System.Text.Encoding.UTF8; int total = math.Add(Convert.ToInt32(Num1.Text), Convert.ToInt32(Num2.Text)); Total.Text = "Total: " + total.ToString(); } </script> <body> <form action="MathClient.aspx" runat=server> Enter the two numbers you want to add and then press the Total button. <p> Number 1: <asp:textbox id="Num1" runat=server/> + Number 2: <asp:textbox id="Num2" runat=server/> = <asp:button text="Total" Onclick="EnterBtn_Click" runat=server/> <p> <asp:label id="Total" runat=server/> </form> </body> </html>
<html> <script language="JSCRIPT" runat="server"> function EnterBtn_Click(src : Object, e : EventArgs){ var math : MyMath.Math = new MyMath.Math() // Set the Content Type to UTF-8. math.RequestEncoding = System.Text.Encoding.UTF8 var iTotal : int = math.Add(Convert.ToInt32(Num1.Text), Convert.ToInt32(Num2.Text)) Total.Text = "Total: " + iTotal.ToString() } </script> <body> <form action="MathClient.aspx" runat=server> Enter the two numbers you want to add and then press the Total button. <p> Number 1: <asp:textbox id="Num1" runat=server/> + Number 2: <asp:textbox id="Num2" runat=server/> = <asp:button text="Total" Onclick="EnterBtn_Click" runat=server/> <p> <asp:label id="Total" runat=server/> </form> </body> </html>

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からWebClientProtocol.RequestEncoding プロパティを検索する場合は、下記のリンクをクリックしてください。

- WebClientProtocol.RequestEncoding プロパティのページへのリンク