Has anyone been able to get the suds soap library to work with the NetSuite WSDL?

前端 未结 5 654
礼貌的吻别
礼貌的吻别 2021-01-20 21:35

Has anyone been able to get the suds soap library to work with the NetSuite WSDL? I get this error when I try to create a client.

from suds.client import Cli         


        
5条回答
  •  攒了一身酷
    2021-01-20 22:16

    Though not the best way to do things, if you're desperate, you can keep trying different versions of their wsdl. I was getting the same error message, so I kept trying until one worked. I went in this order:

    'https://webservices.netsuite.com/wsdl/v2010_2_0/netsuite.wsdl'
    'https://webservices.netsuite.com/wsdl/v2010_1_0/netsuite.wsdl'
    'https://webservices.netsuite.com/wsdl/v2009_2_0/netsuite.wsdl'
    'https://webservices.netsuite.com/wsdl/v2009_1_0/netsuite.wsdl'
    

    'https://webservices.netsuite.com/wsdl/v2009_1_0/netsuite.wsdl' finally worked for me

    EDIT: Based on tponthieux's answer, I realize now that you can use the suds plugin feature to fix the wsdl (I would simply comment on his answer, but I don't have the reputation yet :( ):

    import re
    
    from suds.client import Client
    from suds.plugin import DocumentPlugin
    
    NetSuite_wsdl = 'https://webservices.netsuite.com/wsdl/v2010_2_0/netsuite.wsdl'
    
    
    class Fix_NS_wsdl(DocumentPlugin):
        bad_fault = re.compile(r"(ExceededRequestLimitFault)"
                r"(\">\s*

提交回复
热议问题