Ejemplo n.º 1
0
def write_envelope(version, filename):
    envelope = Envelope(amfVersion=version)
    message = Response(records)
    envelope.__setitem__('message', message)
    stream = remoting.encode(envelope)
    file = open(filename, 'w+')
    file.write(stream.getvalue())
Ejemplo n.º 2
0
def write_envelope(version, filename):
    envelope = Envelope(amfVersion=version)
    message = Response(records)
    envelope.__setitem__('message', message);
    stream = remoting.encode(envelope)
    file = open(filename, 'w+')
    file.write(stream.getvalue())
    'ecmaArray': pyamf.MixedArray(a='1', b='2', c='3'),
    'strictArray': [ 1, 2, 3 ],
    'date': datetime.date(2012, 12, 31),
    'xmlDocument': xmlDocument,
    'typedObject': foo,
})

message1 = Response({
    'text': 'hello'
})

envelope.headers['a'] = 'b';
envelope.headers['c'] = 'd';
envelope.headers['e'] = 'f';

envelope.__setitem__('msg1', message0)
envelope.__setitem__('msg2', message1)

stream = remoting.encode(envelope)

file = open('amf0-all.amf', 'w+')
file.write(stream.getvalue())

#-----------------------------------------------
# AMF0 recordset
#-----------------------------------------------

envelope = Envelope(amfVersion=0)

records = [
    { 'id': 1, 'name': 'Phil' },
Ejemplo n.º 4
0
    'none': None,
    'undef': pyamf.Undefined,
    'ecmaArray': pyamf.MixedArray(a='1', b='2', c='3'),
    'strictArray': [1, 2, 3],
    'date': datetime.date(2012, 12, 31),
    'xmlDocument': xmlDocument,
    'typedObject': foo,
})

message1 = Response({'text': 'hello'})

envelope.headers['a'] = 'b'
envelope.headers['c'] = 'd'
envelope.headers['e'] = 'f'

envelope.__setitem__('msg1', message0)
envelope.__setitem__('msg2', message1)

stream = remoting.encode(envelope)

file = open('amf0-all.amf', 'w+')
file.write(stream.getvalue())

#-----------------------------------------------
# AMF0 recordset
#-----------------------------------------------

envelope = Envelope(amfVersion=0)

records = [{
    'id': 1,