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

前端 未结 5 656
礼貌的吻别
礼貌的吻别 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 21:56

    Yes, suds can connect to NetSuite, but it takes a long time to process the WSDL.

    Here's some sample code:

    # Open NetSuite Session
    wsdlNetSuite = 'https://webservices.netsuite.com/wsdl/v2010_1_0/netsuite.wsdl'
    client = Client(wsdlNetSuite)
    
    # Login
    passport = client.factory.create('ns4:Passport')
    passport.email = 'username@web.com'
    passport.password = 'ABC123'
    passport.account = 123
    loginResponse = client.service.login(passport)
    print 'Login Response: '
    print loginResponse.status
    
    # Get a record
    recordRef = client.factory.create('ns4:RecordRef')
    recordRef._internalId = 127842
    recordRef._type = 'invoice'
    record = client.service.get(recordRef)
    print record
    

    You might also need to try various combinations of Python and SUDS versions. It's not a particularly reliable library.

提交回复
热议问题