I am trying to use foam, but still have not been able to figure it out.
This should be the raw soapy message I need to achieve:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:api="http://api.service.apimember.soapservice.com/">
<soapenv:Header/>
<soapenv:Body>
<api:insertOrUpdateMemberByObj>
<token>t67GFCygjhkjyUy8y9hkjhlkjhuii</token>
<member>
<dynContent>
<entry>
<key>FIRSTNAME</key>
<value>hhhhbbbbb</value>
</entry>
</dynContent>
<email>test@test.com</email>
</member>
</api:insertOrUpdateMemberByObj>
</soapenv:Body>
</soapenv:Envelope>
Therefore, I use foaming to create a member object:
member = client.factory.create('member')
gives:
(apiMember){
attributes =
(attributes){
entry[] = <empty>
}
}
How can I add a βrecordβ?
I tried this:
member.attributes.entry.append({'key':'FIRSTNAME','value':'test'})
which produces this:
(apiMember){
attributes =
(attributes){
entry[] =
{
value = "test"
key = "FIRSTNAME"
},
}
}
However , what I really need:
(apiMember){
attributes =
(attributes){
entry[] =
(entry) {
value = "test"
key = "FIRSTNAME"
},
}
}
How do I achieve this?
source
share