SoapHeaderException コンストラクタ (String, XmlQualifiedName, Exception)
SoapHeaderException クラスの新しいインスタンスを初期化します。
名前空間: System.Web.Services.Protocols
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文
'宣言
Public Sub New ( _
message As String, _
code As XmlQualifiedName, _
innerException As Exception _
)
'使用
Dim message As String
Dim code As XmlQualifiedName
Dim innerException As Exception
Dim instance As New SoapHeaderException(message, code, innerException)
public SoapHeaderException (
string message,
XmlQualifiedName code,
Exception innerException
)
public:
SoapHeaderException (
String^ message,
XmlQualifiedName^ code,
Exception^ innerException
)
public SoapHeaderException (
String message,
XmlQualifiedName code,
Exception innerException
)
public function SoapHeaderException (
message : String,
code : XmlQualifiedName,
innerException : Exception
)
適用できません。
パラメータ
- message
例外が発生した理由を示すメッセージ。このパラメータは Message プロパティを設定します。
- code
発生したエラーの種類。このパラメータは Code プロパティを設定します。
- innerException
例外の主要原因への参照。このパラメータは InnerException プロパティを設定します。
使用例
<%@ WebService Language="VB" Class="MathSvc" %>
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols
Public Class MySoapHeader
Inherits SoapHeader
Public number As Integer
End Class 'MySoapHeader
Public Class MathSvc
Inherits WebService
Public mySoapHeader As MySoapHeader
<WebMethod(), SoapHeaderAttribute("mySoapHeader", _
Direction := SoapHeaderDirection.In)> _
Public Function Add(xValue As Single, yValue As Single) As Single
' Process the header from the client.
Try
Dim j As Integer = 100 / mySoapHeader.number
Catch e As Exception
' Throw a SoapHeaderException if an exception is caught during
' header processing.
Throw New SoapHeaderException( _
"An Exception was thrown during the processing of header", _
SoapException.ClientFaultCode, e)
End Try
Return xValue + yValue
End Function 'Add
End Class 'MathSvc
<%@ WebService Language="C#" Class="MathSvc" %>
using System;
using System.Web.Services;
using System.Web.Services.Protocols;
public class MySoapHeader : SoapHeader
{
public int number;
}
public class MathSvc : WebService {
public MySoapHeader mySoapHeader;
[WebMethod]
[SoapHeaderAttribute("mySoapHeader", Direction=SoapHeaderDirection.In)]
public float Add(float xValue, float yValue)
{
// Process the header from the client.
try
{
int j = 100/mySoapHeader.number;
}
catch(Exception e)
{
// Throw a SoapHeaderException if an exception is caught during
// header processing.
throw new SoapHeaderException(
"An Exception was thrown during the processing of header",
SoapException.ClientFaultCode, e);
}
return(xValue + yValue);
}
}
<%@ WebService Language="VJ#" Class="MathSvc" %>
import System.*;
import System.Web.Services.*;
import System.Web.Services.Protocols.*;
public class MySoapHeader extends SoapHeader
{
public int number;
} //MySoapHeader
public class MathSvc extends WebService
{
public MySoapHeader mySoapHeader;
/** @attribute WebMethod()
*/
/** @attribute SoapHeaderAttribute("mySoapHeader", Direction
= SoapHeaderDirection.In)
*/
public float Add(float xValue, float yValue) throws SoapHeaderException
{
// Process the header from the client.
try {
int j = 100 / mySoapHeader.number;
}
catch (System.Exception e) {
// Throw a SoapHeaderException if an exception is caught during
// header processing.
throw new SoapHeaderException(
"An Exception was thrown during the processing of header",
SoapException.ClientFaultCode, e);
}
return xValue + yValue;
} //Add
} //MathSvc
プラットフォーム
Windows 98,Windows Server 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
Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。
バージョン情報
.NET Framework
サポート対象 : 3.0,2.0,1.1,1.0
.NET Compact Framework
サポート対象 : 2.0
参照
関連項目
SoapHeaderException クラス
SoapHeaderException メンバ
System.Web.Services.Protocols 名前空間