방법: SOAP 확장이 구성된 경우 캐시된 데이터 초기화
이 항목은 레거시 기술과 관련된 것입니다. 이제 XML Web services와 XML Web services 클라이언트는 다음을 사용하여 만들어야 합니다. Windows Communication Foundation.
다음 코드 예제에서는 SOAP 확장의 구성 방법에 따라 GetInitializer 메서드에서 캐시된 데이터를 초기화합니다. 특성(이 경우 TraceExtensionAttribute
)을 사용하여 SOAP 확장을 구성하는 경우 특성에 지정된 파일 이름이 캐시됩니다. 구성 파일을 사용하여 SOAP 확장을 구성하는 경우 웹 서비스 형식을 기반으로 캐시된 파일 이름을 계산합니다.
예제
' When the SOAP extension is accessed for the first time, the XML
' Web service method it is applied to is accessed to store the file
' name passed in, using the corresponding SoapExtensionAttribute.
Public Overloads Overrides Function GetInitializer(methodInfo As _
LogicalMethodInfo, attribute As SoapExtensionAttribute) As Object
Return CType(attribute, TraceExtensionAttribute).Filename
End Function
' The extension was configured to run using a configuration file
' instead of an attribute applied to a specific Web service method.
' Return a file name, based on the class implementing the XML Web
' service's type.
Public Overloads Overrides Function GetInitializer(WebServiceType As _
Type) As Object
' Return a file name to log the trace information, based on the type.
Return "C:\" + WebServiceType.FullName + ".log"
End Function
// When the SOAP extension is accessed for the first time, the XML
// Web service method it is applied to is accessed to store the file
// name passed in, using the corresponding SoapExtensionAttribute.
public override object GetInitializer(LogicalMethodInfo methodInfo,
SoapExtensionAttribute attribute)
{
return ((TraceExtensionAttribute) attribute).Filename;
}
// The extension was configured to run using a configuration file instead of
// an attribute applied to a specific Web service method.
public override object GetInitializer(Type WebServiceType)
{
// Return a file name to log the trace information, based on the type.
return "C:\\" + WebServiceType.FullName + ".log";}