我有一个错误:
Type 'MyAppApp.Web.MyAppWebService.NotifierAuthHeader' cannot inherit from a type that is not marked with DataContractAttribute or SerializableAttribute. Consider marking the base type 'System.Web.Services.Protocols.SoapHeader' with DataContractAttribute or SerializableAttribute, or removing them from the derived type.
执行此 wcf 方法时:
<OperationContract()> <WebMethod(Description:="Gets details about selected PDF document")> _
Public Function GetPdfDetails(ByVal pdfName As String) As String
我无法更改 SoapHeader
,因为它是框架类
Public MustInherit Class SoapHeader
Inherits System.Object
Member of System.Web.Services.Protocols
我在课堂上使用这个 NotifierAuthHeader
类
Imports System.Web.Services.Protocols
Imports System.Runtime.Serialization
Public Class NotifierAuthHeader
Inherits SoapHeader
Public HandlerId As Integer
Public Guid As Byte()
End Class
我有点困惑。我怎样才能让它工作?