メッセージのリストをに変換する次のコードがありますjson
。
Public Class MessageService
<OperationContract()> _
Public Function GetMessage(Id As Integer) As String
Dim msg As New Message()
Dim stream As New MemoryStream()
Dim serializer As New DataContractJsonSerializer(GetType(NewMessage))
Dim dtMessages = msg.getUnreadMessages("3A3458")
Dim list As New ArrayList
Dim m As New NewMessage()
m.Id = 1
m.Text = "mmsg"
list.Add(m)
list.Add(m)
serializer.WriteObject(stream, list)
stream.Position = 0
Dim streamReader As New StreamReader(stream)
Return streamReader.ReadToEnd()
End Function
End Class
しかし、次のエラーが発生しました:
The server was unable to process the request due to an internal error.
For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client,
or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.