Hi!

I have this WSDL:

<wsdl:definitions xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing" xmlns:tns="lamoda" xmlns:plink="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:xop="http://www.w3.org/2004/08/xop/include"xmlns:senc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s12env="http://www.w3.org/2003/05/soap-envelope/" xmlns:s12enc="http://www.w3.org/2003/05/soap-encoding/" xmlns:xs="http://www.w3.org/2001/XMLSchema"xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"targetNamespace="lamoda" name="Application">
<wsdl:types>
<xs:schema targetNamespace="lamoda" elementFormDefault="qualified">
<xs:complexType name="put_subscriberResponse">
<xs:sequence>
<xs:element name="put_subscriberResult" type="tns:FSubscriber"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="FSubscriber">
<xs:sequence>
<xs:element name="id" type="xs:integer"/>
<xs:element name="creator_id" type="xs:integer"/>
<xs:element name="created_time" type="xs:dateTime"/>
<xs:element name="editor_id" type="xs:integer"/>
<xs:element name="edited_time" type="xs:dateTime"/>
<xs:element name="customer_id" type="xs:integer"/>
<xs:element name="email" type="xs:string"/>
<xs:element name="status" type="xs:string"/>
<xs:element name="sms_status" type="xs:string"/>
<xs:element name="change_status_at" type="xs:dateTime"/>
<xs:element name="confirm_code" type="xs:string"/>
<xs:element name="gender" type="xs:string"/>
<xs:element name="auto_gender" type="xs:string"/>
<xs:element name="location" type="xs:string"/>
<xs:element name="utm_source" type="xs:string"/>
<xs:element name="utm_medium" type="xs:string"/>
<xs:element name="utm_campaign" type="xs:string"/>
<xs:element name="utm_content" type="xs:string"/>
<xs:element name="utm_term" type="xs:string"/>
<xs:element name="utm_keyword" type="xs:string"/>
<xs:element name="url" type="xs:string"/>
<xs:element name="referer" type="xs:string"/>
<xs:element name="domain" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="year_of_birth" type="xs:integer"/>
<xs:element name="region" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="put_subscriber">
<xs:sequence>
<xs:element name="subscriber" type="tns:Subscriber"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Subscriber">
<xs:sequence>
<xs:element name="id" type="xs:integer" minOccurs="0" nillable="true"/>
<xs:element name="creator_id" type="xs:integer" minOccurs="0" nillable="true"/>
<xs:element name="created_time" type="xs:dateTime" minOccurs="0" nillable="true"/>
<xs:element name="editor_id" type="xs:integer" minOccurs="0" nillable="true"/>
<xs:element name="edited_time" type="xs:dateTime" minOccurs="0" nillable="true"/>
<xs:element name="customer_id" type="xs:integer" minOccurs="0" nillable="true"/>
<xs:element name="email" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="status" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="sms_status" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="change_status_at" type="xs:dateTime" minOccurs="0" nillable="true"/>
<xs:element name="confirm_code" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="gender" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="auto_gender" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="location" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="utm_source" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="utm_medium" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="utm_campaign" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="utm_content" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="utm_term" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="utm_keyword" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="url" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="referer" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="domain" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="name" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="year_of_birth" type="xs:integer" minOccurs="0" nillable="true"/>
<xs:element name="region" type="xs:string" minOccurs="0" nillable="true"/>
<xs:element name="city" type="xs:string" minOccurs="0" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Subscriber" type="tns:Subscriber"/>
<xs:element name="put_subscriber" type="tns:put_subscriber"/>
<xs:element name="FSubscriber" type="tns:FSubscriber"/>
<xs:element name="put_subscriberResponse" type="tns:put_subscriberResponse"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="put_subscriber">
<wsdl:part name="put_subscriber" element="tns:put_subscriber"/>
</wsdl:message>
<wsdl:message name="put_subscriberResponse">
<wsdl:part name="put_subscriberResponse" element="tns:put_subscriberResponse"/>
</wsdl:message>
<wsdl:service name="SubscriptionService">
<wsdl:port name="Application" binding="tns:Application">
<soap:address location="http://127.0.0.1:8000/api/newsletter/"/>
</wsdl:port>
</wsdl:service>
<wsdl:portType name="Application">
<wsdl:operation name="put_subscriber" parameterOrder="put_subscriber">
<wsdl:documentation>
Create a new or update an existing subscriber. If `id` is None or not passed and new subscription is created, otherwise the existing subscription is updated.
</wsdl:documentation>
<wsdl:input name="put_subscriber" message="tns:put_subscriber"/>
<wsdl:output name="put_subscriberResponse" message="tns:put_subscriberResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Application" type="tns:Application">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="put_subscriber">
<soap:operation soapAction="put_subscriber" style="document"/>
<wsdl:input name="put_subscriber">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="put_subscriberResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>


And suds gets this response (taken from logs):

<senv:Envelope xmlns:tns="lamoda" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/">
    <senv:Body>
        <tns:put_subscriberResponse>
            <tns:put_subscriberResult>
                <tns:id>5346529</tns:id>
                <tns:creator_id xsi:nil="true"/>
                ...
                <tns:confirm_code></tns:confirm_code>
                ...
            </tns:put_subscriberResult>
        </tns:put_subscriberResponse>
    </senv:Body>
</senv:Envelope>


On ipdb breakpoint:

ipdb> suds_obj
(Subscriber){
   id = 5346529
   creator_id = None
   created_time = 2013-07-08 17:39:59
   editor_id = None
   edited_time = 2013-07-10 18:10:55.086515
   customer_id = 1
   email = "asdf"
   status = "SUBSCRIBED"
   sms_status = "SUBSCRIBED"
   change_status_at = None
   confirm_code = None
   gender = None
   auto_gender = None
   location = None
   utm_source = None
   utm_medium = None
   utm_campaign = None
   utm_content = None
   utm_term = None
   utm_keyword = None
   url = None
   referer = None
   domain = None
   name = None
   year_of_birth = 0
   region = None
   city = None
 }
ipdb> suds_obj.__dict__
*** AttributeError: Metadata instance has no attribute '__metadata__'


Questions:
1. `confirm_code` is an empty string, but it is transformed to None. I've seen this https://lists.fedoraproject.org/pipermail/suds/2010-May/000882.html and i made returned type fields to be mandatory, but this didn't help
2. In WSDL the returned complex type is called FSubscriber, but in the console the suds obj representation starts with Subscriber.

I want confirm_code to be automatically transformed into '' instead of None. How  do i do this?

3. In the console i cannot introspect suds object: AttributeError: Metadata instance has no attribute '__metadata__'

Thank you!

Victor Varvaryuk