获取服务类型

时间:2015-06-11 08:27:49

标签: python wsdl suds

Client实例为client我可以print client获取客户对象的字符串表示,即:

Suds ( https://fedorahosted.org/suds/ )  version: 0.4 GA  build: R699-20100913

Service ( RoutingService ) tns="http://tempuri.org/"
   Prefixes (11)
      ns0 = "http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.AX.Framework.Services"
      ns1 = "http://schemas.microsoft.com/2003/10/Serialization/"
      ns2 = "http://schemas.microsoft.com/2003/10/Serialization/Arrays"
      ns3 = "http://schemas.microsoft.com/dynamics/2006/02/documents/EntityKey"
      ns4 = "http://schemas.microsoft.com/dynamics/2006/02/documents/EntityKeyList"
      ns5 = "http://schemas.microsoft.com/dynamics/2006/02/documents/QueryCriteria"
      ns6 = "http://schemas.microsoft.com/dynamics/2008/01/documents/Fault"
      ns7 = "http://schemas.microsoft.com/dynamics/2008/01/documents/LTExchCurrency"
      ns8 = "http://schemas.microsoft.com/dynamics/2008/01/sharedtypes"
      ns9 = "http://schemas.microsoft.com/dynamics/2010/01/datacontracts"
      ns10 = "http://tempuri.org"
   Ports (2):
      (serviceEndpoint)
         Methods (0):
         Types (2949):
            ns6:AifFault
            ns6:ArrayOfFaultMessage
            ns6:ArrayOfFaultMessageList
            ns0:ArrayOfInfologMessage
...

我想知道如何在不用手动重新分析这个字符串的情况下在Python对象中获取Types命名空间?

例如ns6类型的AifFault

1 个答案:

答案 0 :(得分:0)

怎么样:

print client.wsdl.tns