Wobbel Posted November 20, 2010 Report Share Posted November 20, 2010 Hi all, I just started using the library and I'm running v 2.2 (stable release) but i'm running into some issues when performing a remove on a torrent. I'v traced it to the point where the lib requestes a refresh of the labels and torrents (with a cache key) and I get the following message:{"Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''. "}stacktrace:Server stack trace: at ReadArrayOfstringFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) at System.Runtime.Serialization.Json.JsonCollectionDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context) at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context) at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, String name, String ns) at ReadRemovedTorrentsListFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) at System.Runtime.Serialization.Json.JsonCollectionDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context) at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context) at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, String name, String ns) at ReadUpdatedTorrentsAndLabelsFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] ) at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context) at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context) at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns) at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName) at System.Runtime.Serialization.XmlObjectSerializer.InternalReadObject(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName) at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.ReadObject(Message message) at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.DeserializeReply(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.DemultiplexingClientMessageFormatter.DeserializeReply(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.CompositeClientFormatter.DeserializeReply(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Cleverscape.UTorrentClient.WebClient.ServiceDefinition.IUTorrentWebClient.GetUpdatedTorrentsAndLabels(String CacheID, String token) at Cleverscape.UTorrentClient.WebClient.UTorrentWebClient.GetTorrentsAndLabelsCached() in --------------------------------------\Cleverscape.UTorrentClient.WebClient\UTorrentWebClient.cs:line 620 at Cleverscape.UTorrentClient.WebClient.UTorrentWebClient.GetTorrentsAndLabels(Boolean ForceUpdate) inI'm not new at using WCF or c# but I'v never worked with JSON so I'm not really sure where to look for the problem. I checked with fiddler and the return seem corectly formed so I'm a bit stuck since I don't know the lib I'm trying to debug that well either.Found the problem, seems there have been some changes in the return format for torrent updates and they require a change in return contract else you encounter a deserialisation error. Change is that the removed torrents is not a list of string arrays anymore but just of strings. This has however some effects in other parts of the code and I'm still testing the rest to see if I haven broken anything else. I might post a full revision as soon as I can figure out some of the reasons behind some of the currently strange looking constructs. ex. returning a enumerable in a method that deletes a torrent that matchs a certain hash... shouldn't there be only one torrent that matches a hash, thats kind of the point of a hash no? Link to comment Share on other sites More sharing options...
Syn Posted November 24, 2010 Report Share Posted November 24, 2010 Hello I am having a problem with the TorrentFinishedDownloading event. It seems to not be firing in the FAT Controller and in my own program as well. Was wondering if anyone else was having similar problems?Here's my code:I first call my function InitUclientprivate void InitUclient() { uclient = new UTorrentWebClient(thost + ":" + tport, tuser, tpass, true); uclient.TorrentsUpdated += new EventHandler(uclient_TorrentsUpdated); uclient.TorrentFinishedDownloading += new TorrentEventHandler(uclient_TorrentFinishedDownloading); uclient.TorrentAdded += new TorrentEventHandler(uclient_TorrentAdded);}then I the uclient_TorrentFinishedDownloading functionvoid uclient_TorrentFinishedDownloading(object sender, TorrentEventArgs e) { MessageBox.Show(e.Torrent.Name + " FINISHED"); }this same code works fine with the TorrentAdded Event. I am using Utorrent 1.8.5 and was wondering if anyone else was having this problem. Link to comment Share on other sites More sharing options...
grimstoner Posted February 10, 2011 Report Share Posted February 10, 2011 Anyone still maintaining this project?Everytime I try calling a service method (like getToken()), I get this error message :"Envelope Version 'EnvelopeNone (http://schemas.microsoft.com/ws/2005/05/envelope/none)' does not support adding Message Headers."on the line where the call is made.Anyone run into the same issue? I've been searching a while now... Did find something about Skype, but that didn't fix it.Seriously considering refactoring this library using the .NET 4's async fx. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.