SoapHeaderException クラス
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文
XML Web サービス クライアントが MustUnderstand プロパティを true に設定して XML Web サービス メソッドの呼び出しに SOAP ヘッダーを追加する場合、XML Web サービス メソッドは DidUnderstand プロパティを true に設定する必要があります。それ以外の場合は、SoapHeaderException がスローされます。
Detail プロパティは、SoapHeaderException の SOAP 仕様により設定できません。
メモ |
---|
SOAP 1.1 仕様をサービス プロトコルとして使用するアプリケーションは、SoapHeaderException を使用して SOAP 違反にアクセスできます。ただし、SOAP 1.2 仕様を使用するアプリケーションは、SoapException を使用して SOAP 違反にアクセスする必要があります。 |
次の例では、XML Web サービス クライアントが MyWebMethod XML Web サービス メソッドを呼び出し、MustUnderstand プロパティが true に設定された MyHeader 型の SOAP ヘッダーを渡しています。XML Web サービス メソッドが MyHeader SOAP ヘッダーの DidUnderstand プロパティを true に設定しない場合は、SoapHeaderException がスローされます。
Imports System Public Class Sample Public Shared Sub Main() Dim ws As New MyWebService() Try Dim customHeader As New MyHeader1() customHeader.MyValue = "Header Value for MyValue" customHeader.MustUnderstand = True ws.myHeader = customHeader Dim results As Integer results = ws.MyWebMethod(3,5) Catch e As Exception Console.WriteLine("Exception: {0}", e.ToString()) End Try End Sub End Class
using System; public class Sample { public static void Main() { MyWebService ws = new MyWebService(); try { MyHeader customHeader = new MyHeader(); customHeader.MyValue = "Header Value for MyValue"; customHeader.MustUnderstand = true; ws.myHeader = customHeader; int results = ws.MyWebMethod(3,5); } catch (Exception e) { Console.WriteLine ("Exception: {0}", e.ToString()); } } }
int main() { MyWebService^ ws = gcnew MyWebService; try { MyHeader^ customHeader = gcnew MyHeader; customHeader->MyValue = "Header Value for MyValue"; customHeader->MustUnderstand = true; ws->myHeader = customHeader; int results = ws->MyWebMethod( 3, 5 ); } catch ( Exception^ e ) { Console::WriteLine( "Exception: {0}", e ); } }
import System.*; public class Sample { public static void main(String[] args) { MyWebService ws = new MyWebService(); try { MyHeader customHeader = new MyHeader(); customHeader.myValue = "Header Value for MyValue"; customHeader.set_MustUnderstand(true); ws.myHeader = customHeader; int results = ws.MyWebMethod(3, 5); } catch (System.Exception e) { Console.WriteLine("Exception: {0}", e.ToString()); } } //main } //Sample
System.Exception
System.SystemException
System.Web.Services.Protocols.SoapException
System.Web.Services.Protocols.SoapHeaderException
プラットフォーム
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に収録されているすべての辞書からSoapHeaderException クラスを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からSoapHeaderException クラスを検索
- SoapHeaderException クラスのページへのリンク