Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list available suds factory types

Tags:

python

suds

The short version is I'm trying to figure out if there's a way to list all the types available to calls to Client.factory.create() after loading a WSDL.

I have a parameter that is of a complex type that includes an array of another complex type. The suds factory doesn't seem to know how to create the type that belongs in the array, so I don't know how to populate the array. When I pass the type name into factory.create() I get suds.TypeNotFound. I'm hoping I'm just getting the name wrong and that if I can list the available types I can pick it out.

like image 994
gbutler Avatar asked Mar 24 '23 21:03

gbutler


1 Answers

You can get a list of methods and types by simply printing the client. Here is an example of the output:

Suds ( https://fedorahosted.org/suds/ )  version: 0.3.9 GA  build: R659-20100219


Service ( PartnerAPI ) tns="http://exacttarget.com/wsdl/partnerAPI"
   Prefixes (2)
      ns0 = "http://exacttarget.com/wsdl/partnerAPI"
      ns1 = "urn:fault.partner.exacttarget.com"
   Ports (1):
      (Soap)
         Methods (13):
            Configure(ConfigureOptions Options, xs:string Action, Configurations Configurations, )
            Create(CreateOptions Options, APIObject[] Objects, )
            Delete(DeleteOptions Options, APIObject[] Objects, )
            Describe(ArrayOfObjectDefinitionRequest DescribeRequests, )
            Execute(ExecuteRequest[] Requests, )
            Extract(ExtractRequest[] Requests, )
            GetSystemStatus(SystemStatusOptions Options, )
            Perform(PerformOptions Options, xs:string Action, Definitions Definitions, )
            Query(QueryRequest QueryRequest, )
            Retrieve(RetrieveRequest RetrieveRequest, )
            Schedule(ScheduleOptions Options, xs:string Action, ScheduleDefinition Schedule, Interactions Interactions, )
            Update(UpdateOptions Options, APIObject[] Objects, )
            VersionInfo(xs:boolean IncludeVersionHistory, )
         Types (285):
            ns1:APIFault
            APIObject
            APIProperty
            Account
            AccountDataItem
            AccountPrivateLabel
            AccountTypeEnum
            AccountUser
            AddressStatus
            ...

Any of the Types can be created with factory.create().

like image 177
jordanm Avatar answered Apr 06 '23 05:04

jordanm