SoapClientMessage SoapClientMessage SoapClientMessage SoapClientMessage Class

정의

특정 SoapMessageStage에서 XML Web services 클라이언트가 보내는SOAP 요청이나 받는 SOAP 응답의 데이터를 나타냅니다.Represents the data in a SOAP request sent or a SOAP response received by an XML Web service client at a specific SoapMessageStage. 이 클래스는 상속될 수 없습니다.This class cannot be inherited.

public ref class SoapClientMessage sealed : System::Web::Services::Protocols::SoapMessage
public sealed class SoapClientMessage : System.Web.Services.Protocols.SoapMessage
type SoapClientMessage = class
    inherit SoapMessage
Public NotInheritable Class SoapClientMessage
Inherits SoapMessage
상속
SoapClientMessageSoapClientMessageSoapClientMessageSoapClientMessage

예제

다음 코드 조각에는 XML 웹 서비스 클라이언트에서 보내고 받는 SOAP 메시지를 기록 하는 SOAP 확장의 일부입니다.The following code fragment is part of a SOAP extension that logs the SOAP messages sent and received by an XML Web service client. 이 특정 조각 처리를 SoapClientMessage 에 전달 합니다 SoapExtension.ProcessMessage 의 속성을 작성 하 여 SOAP 확장의 메서드는 SoapClientMessage 로그 파일에.This specific fragment processes the SoapClientMessage passed into the SoapExtension.ProcessMessage method of the SOAP extension by writing properties of the SoapClientMessage to the log file.

// Process the SOAP message received and write to a log file.
void ProcessMessage( SoapMessage^ message )
{
   switch ( message->Stage )
   {
      case SoapMessageStage::BeforeSerialize:
         break;
      case SoapMessageStage::AfterSerialize:
         WriteOutput( dynamic_cast<SoapClientMessage^>(message) );
         break;
      case SoapMessageStage::BeforeDeserialize:
         WriteInput( dynamic_cast<SoapClientMessage^>(message) );
         break;
      case SoapMessageStage::AfterDeserialize:
         break;
      default:
         throw gcnew Exception( "invalid stage" );
   }
}

// Write the contents of the outgoing SOAP message to the log file.
void WriteOutput( SoapClientMessage^ message )
{
   newStream->Position = 0;
   FileStream^ myFileStream = gcnew FileStream( filename, FileMode::Append,
      FileAccess::Write );
   StreamWriter^ myStreamWriter = gcnew StreamWriter( myFileStream );
   myStreamWriter->WriteLine(
      "================================== Request at {0}", DateTime::Now );
   
   // Print to the log file the request header field for SoapAction header.
   myStreamWriter->WriteLine( "The SoapAction Http request header field is: " );
   myStreamWriter->WriteLine( "\t{0}", message->Action );
   
   // Print to the log file the type of the client that invoked 
   // the XML Web service method.
   myStreamWriter->WriteLine( "The type of the client is: " );
   if ( (message->Client->GetType())->Equals( typeid<MathSvc^> ) )
   {
      myStreamWriter->WriteLine( "\tMathSvc" );
   }
   
   // Print to the log file the method invoked by the client.
   myStreamWriter->WriteLine(
      "The method that has been invoked by the client is:" );
   myStreamWriter->WriteLine( "\t{0}", message->MethodInfo->Name );
   
   // Print to the log file if the method invoked is OneWay.
   if ( message->OneWay )
   {
      myStreamWriter->WriteLine(
         "The client doesn't wait for the server to finish processing" );
   }
   else
   {
      myStreamWriter->WriteLine(
      "The client waits for the server to finish processing" );
   }
   
   // Print to the log file the URL of the site that provides 
   // implementation of the method.
   myStreamWriter->WriteLine(
      "The URL of the XML Web service method that has been requested is: " );
   myStreamWriter->WriteLine( "\t{0}", message->Url );
   myStreamWriter->WriteLine( "The contents of the SOAP envelope are: " );
   myStreamWriter->Flush();
   
   // Copy the contents of one stream to another. 
   Copy( newStream, myFileStream );
   myFileStream->Close();
   newStream->Position = 0;
   
   // Copy the contents of one stream to another. 
   Copy( newStream, oldStream );
}

// Process the SOAP message received and write to a log file.
public override void ProcessMessage(SoapMessage message) 
{
   switch (message.Stage) 
   {
      case SoapMessageStage.BeforeSerialize:
         break;
      case SoapMessageStage.AfterSerialize:
         WriteOutput((SoapClientMessage)message);
         break;
      case SoapMessageStage.BeforeDeserialize:
         WriteInput((SoapClientMessage)message);
         break;
      case SoapMessageStage.AfterDeserialize:
         break;
      default:
         throw new Exception("invalid stage");
   }
}

// Write the contents of the outgoing SOAP message to the log file.
public void WriteOutput(SoapClientMessage message)
{
   newStream.Position = 0;
   FileStream myFileStream = new FileStream(filename, FileMode.Append,
      FileAccess.Write);
   StreamWriter myStreamWriter = new StreamWriter(myFileStream);
   myStreamWriter.WriteLine(
      "================================== Request at "
      + DateTime.Now);

   // Print to the log file the request header field for SoapAction header.
   myStreamWriter.WriteLine("The SoapAction Http request header field is: ");
   myStreamWriter.WriteLine("\t" + message.Action);

   // Print to the log file the type of the client that invoked 
   // the XML Web service method.
   myStreamWriter.WriteLine("The type of the client is: ");
   if((message.Client.GetType()).Equals(typeof(MathSvc)))
      myStreamWriter.WriteLine("\tMathSvc");

   // Print to the log file the method invoked by the client.
   myStreamWriter.WriteLine(
      "The method that has been invoked by the client is:");
   myStreamWriter.WriteLine("\t" + message.MethodInfo.Name);

   // Print to the log file if the method invoked is OneWay.
   if(message.OneWay)
      myStreamWriter.WriteLine(
        "The client doesn't wait for the server to finish processing");
   else
      myStreamWriter.WriteLine(
        "The client waits for the server to finish processing");

   // Print to the log file the URL of the site that provides 
   // implementation of the method.
   myStreamWriter.WriteLine(
      "The URL of the XML Web service method that has been requested is: ");
   myStreamWriter.WriteLine("\t" + message.Url);
   myStreamWriter.WriteLine("The contents of the SOAP envelope are: ");
   myStreamWriter.Flush();

   // Copy the contents of one stream to another. 
   Copy(newStream, myFileStream);
   myFileStream.Close();
   newStream.Position = 0;

   // Copy the contents of one stream to another. 
   Copy(newStream, oldStream);
}
 ' Process the SOAP message received and write to a log file.
 Public Overrides Sub ProcessMessage(message As SoapMessage)
    Select Case message.Stage
       Case SoapMessageStage.BeforeSerialize
       Case SoapMessageStage.AfterSerialize
          WriteOutput(CType(message, SoapClientMessage))
       Case SoapMessageStage.BeforeDeserialize
          WriteInput(CType(message, SoapClientMessage))
       Case SoapMessageStage.AfterDeserialize
       Case Else
             Throw New Exception("invalid stage")
    End Select
 End Sub 'ProcessMessage
 
 
 ' Write the contents of the outgoing SOAP message to the log file.
 Public Sub WriteOutput(message As SoapClientMessage)
    newStream.Position = 0
    Dim myFileStream As New FileStream(filename, FileMode.Append, _
       FileAccess.Write)
    Dim myStreamWriter As New StreamWriter(myFileStream)
    myStreamWriter.WriteLine( _
       "================================== Request at " & DateTime.Now)

    ' Print to the log file the request header field for SoapAction header.
    myStreamWriter.WriteLine("The SoapAction Http request header field is: ")
    myStreamWriter.WriteLine(ControlChars.Tab & message.Action)

    ' Print to the log file the type of the client that invoked
    ' the XML Web service method.
    myStreamWriter.WriteLine("The type of the client is: ")
    If message.Client.GetType().Equals(GetType(MathSvc)) Then
       myStreamWriter.WriteLine(ControlChars.Tab & "MathSvc")
    End If

   ' Print to the log file the method invoked by the client.
    myStreamWriter.WriteLine( _
       "The method that has been invoked by the client is:")
    myStreamWriter.WriteLine(ControlChars.Tab & message.MethodInfo.Name)

    ' Print to the log file if the method invoked is OneWay.
    If message.OneWay Then
       myStreamWriter.WriteLine( _
          "The client doesn't wait for the server to finish processing")
    Else
       myStreamWriter.WriteLine( _
          "The client waits for the server to finish processing")
    End If 

    ' Print to the log file the URL of the site that provides 
    ' implementation of the method.
    myStreamWriter.WriteLine( _
       "The url of the XML Web service method that has been requested is: ")
    myStreamWriter.WriteLine(ControlChars.Tab & message.Url)
    myStreamWriter.WriteLine("The contents of the SOAP envelope are: ")
    myStreamWriter.Flush()

    ' Copy the contents of one stream to another. 
    Copy(newStream, myFileStream)
    myStreamWriter.Close()
    myFileStream.Close()
    newStream.Position = 0

    ' Copy the contents of one stream to another. 
    Copy(newStream, oldStream)
End Sub 'WriteOutput

속성

Action Action Action Action

SOAP 요청이나 SOAP 응답에 대한 SOAPAction HTTP 요청 헤더 필드를 가져옵니다.Gets the SOAPAction HTTP request header field for the SOAP request or SOAP response.

Client Client Client Client

SoapHttpClientProtocol에서 파생되는 클라이언트 프록시 클래스의 인스턴스를 가져옵니다.Gets an instance of the client proxy class, which derives from SoapHttpClientProtocol.

ContentEncoding ContentEncoding ContentEncoding ContentEncoding

Content-Encoding HTTP 헤더의 내용을 가져오거나 설정합니다.Gets or sets the contents of the Content-Encoding HTTP header.

(Inherited from SoapMessage)
ContentType ContentType ContentType ContentType

SOAP 요청이나 SOAP 응답의 HTTP Content-Type을 가져오거나 설정합니다.Gets or sets the HTTP Content-Type of the SOAP request or SOAP response.

(Inherited from SoapMessage)
Exception Exception Exception Exception

XML Web services 메서드에 대한 호출에서 SoapException을 가져옵니다.Gets the SoapException from the call to the XML Web service method.

(Inherited from SoapMessage)
Headers Headers Headers Headers

현재 SOAP 요청이나 SOAP 응답에 적용된 SOAP 헤더의 컬렉션입니다.A collection of the SOAP headers applied to the current SOAP request or SOAP response.

(Inherited from SoapMessage)
MethodInfo MethodInfo MethodInfo MethodInfo

해당 SOAP 요청을 위한 XML Web services 메서드의 메서드 프로토타입 표현을 가져옵니다.Gets a representation of the method prototype of the XML Web service method for which the SOAP request is intended.

OneWay OneWay OneWay OneWay

서버에서 XML Web services 메서드의 처리를 마칠 때까지 클라이언트가 대기하는지 여부를 나타내는 값을 가져옵니다.Gets a value indicating whether the client waits for the server to finish processing an XML Web service method.

SoapVersion SoapVersion SoapVersion SoapVersion

XML Web services와 통신하는 데 사용되는 SOAP 프로토콜의 버전을 가져옵니다.Gets the version of the SOAP protocol used to communicate with the XML Web service.

Stage Stage Stage Stage

SoapMessageStageSoapMessage을 가져옵니다.Gets the SoapMessageStage of the SoapMessage.

(Inherited from SoapMessage)
Stream Stream Stream Stream

SOAP 요청이나 SOAP 응답을 Stream 형식으로 표시되는 데이터를 가져옵니다.Gets the data representing the SOAP request or SOAP response in the form of a Stream.

(Inherited from SoapMessage)
Url Url Url Url

해당 XML Web services의 URL을 가져옵니다.Gets the URL of the XML Web service.

메서드

EnsureInStage() EnsureInStage() EnsureInStage() EnsureInStage()

파생 클래스에서 재정의된 경우 현재 SoapMessageStage가 in 매개 변수를 사용할 수 있는 단계임을 어설션합니다.When overridden in a derived class, asserts that the current SoapMessageStage is a stage where in parameters are available.

(Inherited from SoapMessage)
EnsureOutStage() EnsureOutStage() EnsureOutStage() EnsureOutStage()

파생 클래스에서 재정의된 경우 현재 SoapMessageStage 단계가 out 매개 변수를 사용할 수 있는 단계임을 어설션합니다.When overridden in a derived class, asserts that the current SoapMessageStage stage is a stage where out parameters are available.

(Inherited from SoapMessage)
EnsureStage(SoapMessageStage) EnsureStage(SoapMessageStage) EnsureStage(SoapMessageStage) EnsureStage(SoapMessageStage)

XML Web services 메서드에 대한 호출 SoapMessageStage가 통과한 단계인지 확인합니다.Ensures that the SoapMessageStage of the call to the XML Web service method is the stage or stages passed in. 현재 처리 중인 단계가 통과한 단계가 아니면 예외가 throw됩니다.If the current processing stage is not one of the stages passed in, an exception is thrown.

(Inherited from SoapMessage)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(Inherited from Object)
GetInParameterValue(Int32) GetInParameterValue(Int32) GetInParameterValue(Int32) GetInParameterValue(Int32)

지정된 인덱스에 있는 XML Web services 메서드로 전달되는 매개 변수를 가져옵니다.Gets the parameter passed into the XML Web service method at the specified index.

(Inherited from SoapMessage)
GetOutParameterValue(Int32) GetOutParameterValue(Int32) GetOutParameterValue(Int32) GetOutParameterValue(Int32)

지정된 인덱스에 있는 XML Web services 메서드로 전달되는 out 매개 변수를 가져옵니다.Gets the out parameter passed into the XML Web service method at the specified index.

(Inherited from SoapMessage)
GetReturnValue() GetReturnValue() GetReturnValue() GetReturnValue()

웹 서비스 메서드의 반환 값을 가져옵니다.Gets the return value of an XML Web service method.

(Inherited from SoapMessage)
GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(Inherited from Object)

적용 대상