Python Access WebService

Source: Internet
Author: User

<span style= "font-family:arial, Helvetica, Sans-serif; Background-color:rgb (255, 255, 255); " > Now the most popular is suds, but there are still many bugs are not fixed, as if no one updated </span>

Import sysfrom suds.client Import clientsys.setrecursionlimit ($) Test_url = ' http://webservices.amazon.com/ awsecommerceservice/awsecommerceservice.wsdl ' url = ' http://localhost/IdentifierService.svc?wsdl ' client = Client ( URL, Cache=none)
Suds is really easy to use

But there were errors after the run, and the other WSDL addresses were fine.

Google also found that suds and the. NET platform seem a little incompatible

And this WSDL is the. NET platform, the evil. Net

Can't say common, but I met runtimeerror:maximum recursion depth exceeded the first time I used it.

It means recursion is too deep, and Python's default recursion depth is 1000.

You can modify the depth value, but it doesn't help.

Import Sys

Sys.setrecursionlimit (1500)


Finally had to change the tool, with the soapy,soappy,pysimplesoap,soaplib really quickly use it again

Finally, only Zsi is available

From ZSI import serviceproxyurl = ' http://localhost/IdentifierService.svc?wsdl ' proxy = serviceproxy.serviceproxy (URL) #是两个ServiceProxyperson = "{    ' IDNumber ': ' 4123412412423 ',    ' Name ': ' Zhang San '} ' account = ' {    ' UserName ': ' admin ', '    Password ': ' 123456 '} "response = Proxy. Exactcheckbyjson (Request=person, Cred=account)
Where Exactcheckjson is the service provided by WebService

and the parameter must be this form, if directly on the parameter, will be reported ypeerror:not supporting soapenc:arrays or xsd:list error

Then my request with cred is an excuse for the document provided, and not change ~


Python Access WebService

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.