views:

5

answers:

0

I'm using the Python SUDS library to talk with ExactTarget. I've been using various versions (SUDS 0.3.6 under Python 2.5, SUDS 0.3.8 and 0.4 under Python 2.6) and each version seems to have its own little quibbles.

I'd prefer using 0.4 (since it's the latest and seems to have good caching), but I'm getting an error with my web service because SUDS likes to include unused fields in its message.

For example, here's a code segment that is generated under 0.3.8:

   <SOAP-ENV:Body>
      <ns0:CreateRequest>
         <ns0:Options xsi:type="ns0:CreateOptions">
         <ns0:Objects xsi:type="ns0:TriggeredSend">
            <ns0:TriggeredSendDefinition xsi:type="ns0:TriggeredSendDefinition">
               <ns0:CustomerKey>triggered_send_test
            </ns0:TriggeredSendDefinition>
            <ns0:Subscribers xsi:type="ns0:Subscriber">
               <ns0:EmailAddress>[email protected]
               <ns0:SubscriberKey>[email protected]
            </ns0:Subscribers>
         </ns0:Objects>
      </ns0:CreateRequest>
   </SOAP-ENV:Body>

It contains tags for every field that I've defined.

However, the same code under SUDS 0.4 generates this code segment:

   <ns1:Body>
      <ns0:CreateRequest>
         <ns0:Options></ns0:Options>
         <ns0:Objects xsi:type="ns0:TriggeredSend">
            <ns0:TriggeredSendDefinition>
               <ns0:CustomerKey>triggered_send_test</ns0:CustomerKey>
               <ns0:SourceAddressType/>
               <ns0:DomainType/>
               <ns0:HeaderSalutationSource/>
               <ns0:FooterSalutationSource/>
               <ns0:TriggeredSendType/>
               <ns0:TriggeredSendStatus/>
            </ns0:TriggeredSendDefinition>
            <ns0:Subscribers>
               <ns0:EmailAddress>[email protected]</ns0:EmailAddress>
               <ns0:SubscriberKey>[email protected]</ns0:SubscriberKey>
               <ns0:Status/>
               <ns0:EmailTypePreference/>
               <ns0:PrimarySMSPublicationStatus/>
            </ns0:Subscribers>
         </ns0:Objects>
      </ns0:CreateRequest>
   </ns1:Body>

You'll notice that there are additional tags added that are blank. Yes, these tags are defined in the ExactTarget WSDL, but ExactTarget doesn't like them being defined as empty. The first example worked fine (where the tags weren't included), but it hates them being included as empty tags.

Rather than going back and defining every tag (even where it isn't useful), is there a way to tell SUDS 0.4 not to generate those tags?

Thanks!