I have similar problem, in which I am sending a class object over wamp protocol.
the class looks like this,
self.reqId = reqId
self.flag = flag
self.priority = priority
self.messageData = messageData
And I am trying to send it with,
here wampclient is object of
But I get error as,
invalid type for parameter ‘event’ - not JSON serializable
I tried overriding, _serializable and _unserializable in above WampClient class with,
def _serialize(self, obj):
def _unserialize(self, obj):
Still no luck, I get the same JSON error.
I even tries setting encoder with,
def default(self, obj):
Any help will be deeply appreciated.
As I am new to Python as well, I might be wrong with some basic fundamentals of Python.
On Wednesday, February 27, 2013 2:00:08 PM UTC+5:30, Tobias Oberstein wrote:
sure, you can do that today by overriding _serialize/_unserialize that
is mixed in from WampFactory:
Am 27.02.2013 01:01, schrieb mike...@wearetopsecret.com:
Hello Tobias and others,
Recently, I’ve been facing an interesting problem that I suspect has
affected others and I wanted to bring it up to the group to see if my
solution might be incorporated into the main branch of Autobhan.
We’re using Autobahn in conjunction with Django as an application
server. We have an application with many custom classes and a few Django
classes (such as Models), all of which are designed to be returned to a
requesting user either over RPC or as a brokered response in a Pub/Sub
The largest issue we’ve had to face with this approach has been in
passing these custom instances into Autobahn and having it throw
exceptions because the underlying JSON serializer can’t understand
classes which aren’t inherited from basic Python types like ‘dict’,
What I’ve done to make this much easier is to replace the serializer
inside Autobhan serializer with the one provided by the JSON-pickle
This serializer handles custom classes with ease and performs extremely
well. All serializer errors have vanished.
So, my question is this:
Is there interest in having Autobahn support the option to use different
JSON serializers? I’m happy to produce a basic patch for this
functionality but wanted to gauge the interest level and get feedback
You received this message because you are subscribed to the Google
Groups “Autobahn” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.