I have a class
Public Class NotifierAuthHeader
Inherits SoapHeader
Public HandlerId As Integer
Public Guid As Byte()
End Class
which I use in webservice in following methods:
<OperationContract()><WebMethod()> _
public Function GetTestNotifierAuthHeader()
Dim testNotifierAuthHeader as NotifierAuthHeader=new NotifierAuthHeader()
return testNotifierAuthHeader
and
<SoapHeader("auth", GetType(NotifierAuthHeader), Direction:=SoapHeaderDirection.In)> _
<OperationContract()> <WebMethod()> _
Public Function GetUnreadInboxMessages(ByVal handlerId As Integer, ByVal customerGuid As String) As String
The problem is, I can’t compile client WPF application which has this webservice as servicereference, because it say me, that he doesn’t know any NotifierAuthHeader class.
private ServiceReference1.Service1SoapClient _ws = new ServiceReference1.Service1SoapClient();
//Here it says about this error
private ServiceReference1.NotifierAuthHeader _authHdr;
Funny thing is, that I can use GetTestNotifierAuthHeader method at client, but type of return object is..object, not NotifierAuthHeader
What could be wrong with my code?
asmx service is 3.5
and wpf app is 4.0 c#.
Try making your your NotifierAuthHeader serializable