Forum Discussion
Alex__Applebaum
Aug 18, 2012Employee
Ahhh Duhhh. Was something stupid as suspected. After doing it in perl and powershell just fine and looking at the xml going across the wire, finally figured it out. I just had to double wrap that python object (can't just feed it an array syntax like perl/powershell, etc.).
Perl:
$soapResponse = $Field->get_values(
SOAP::Data->name( class_instance_keys => [ $class_instance_key ] ),
SOAP::Data->name( field_instance_names => [ [@fields] ] )
);
Python:
In [13]: field_instance_names_seq = b.LTConfig.Class.typefactory.create('Common.StringSequence')
In [14]: field_instance_names_seq.item = ['include']
In [15]: field_instance_names_seq_seq = b.LTConfig.Class.typefactory.create('Common.StringSequenceSequence')
In [17]: field_instance_names_seq_seq
Out[17]:
(Common.StringSequenceSequence){
_arrayType = ""
_offset = ""
_id = ""
_href = ""
_arrayType = ""
}
In [18]: field_instance_names_seq_seq.item = field_instance_names_seq
In [19]: field_instance_names_seq_seq
Out[19]:
(Common.StringSequenceSequence){
_arrayType = ""
_offset = ""
_id = ""
_href = ""
item =
(Common.StringSequence){
_arrayType = ""
_offset = ""
_id = ""
_href = ""
item[] =
"include",
}
}
In [20]: b.LTConfig.Field.get_values(class_instance_keys = class_instance_key_seq, field_instance_names = field_instance_names_seq_seq )
Out[20]: [[destination loghost { udp(10.20.5.11 port (514)); udp(10.20.4.167 port (514)); };]]
In [21]: field_instance_names_seq.item = ['include','authpriv_from','authpriv_to']
In [22]: field_instance_names_seq_seq
Out[22]:
(Common.StringSequenceSequence){
_arrayType = ""
_offset = ""
_id = ""
_href = ""
item =
(Common.StringSequence){
_arrayType = ""
_offset = ""
_id = ""
_href = ""
item[] =
"include",
"authpriv_from",
"authpriv_to",
}
}
In [23]: b.LTConfig.Field.get_values(class_instance_keys = class_instance_key_seq, field_instance_name
Out[23]:
[[destination loghost { udp(10.20.5.11 port (514)); udp(10.20.4.167 port (514)); };,
notice,
emerg]]
In [24]: