I have a fairly simple service running on the other machine. When I try to call function on that service I have it fails when sending back the request. I have used Microsoft Service Trace Viewer and got the inner exception of the moment that service is failing:
Type 'System.Net.WebException' with data contract name 'WebException:http://schemas.datacontract.org/2004/07/System.Net' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.</
Code for interface:
Imports System.Net
<ServiceKnownType(GetType(Result))>
<ServiceContract> _
Public Interface ISocialMedia
<OperationContract()>
Function PostToTwitter(ByVal Token As String, ByVal TokenSecret As String, ByVal software As SoftwareType, ByVal status As String) As Result
End Interface
<Serializable>
<DataContract()>
Public Class Result
<DataMember()>
Public Property Response As WebResponse
<DataMember()>
Public Property Exception As Exception
End Class
<Serializable>
Public Enum SoftwareType
<EnumMember()>
A
<EnumMember()>
G
<EnumMember()>
S
End Enum
I am quite new to web services and how it works so a bit confused why this is happening. The exception says that I should use KnownTypeAttribute which I have added, but still no luck.