zeep

Parse WSDL with Zeep

心不动则不痛 提交于 2019-12-13 12:14:02
问题 I want to parse a WSDL file with Zeep and get out: All the operations Request xml messages for each operations Any examples on parsing the wsdl? I guess I should use zeep.wsdl and the parse_service method? /A 回答1: updated: import operator from zeep import Client wsdl = 'http://www.soapclient.com/xml/soapresponder.wsdl' client = Client(wsdl=wsdl) for service in client.wsdl.services.values(): print "service:", service.name for port in service.ports.values(): operations = sorted( port.binding.

How to use a complex type from a WSDL with zeep in Python

假装没事ソ 提交于 2019-12-13 12:04:48
问题 I have a WSDL that contains a complex type like so: <xsd:complexType name="string_array"> <xsd:complexContent> <xsd:restriction base="SOAP-ENC:Array"> <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> I have decided to use zeep for the soap client and want to use that type as a parameter to one of the other methods referenced in the WSDL. I can't seem to figure out how to use this type though. When I looked

Python SOAP WSDL works in SOAPpy but not ZSI or zeep

五迷三道 提交于 2019-12-13 08:47:52
问题 I need a python SOAP library that can handle multipart attachments. My understanding is that this is not supported by SOAPpy or suds but that it is supported by ZSI and zeep. However, while SOAPpy works just fine with the WSDL file that I need to use, ZSI and zeep give me errors. Here is the WSDL file: http://nva1wss.webex.com/nbr/services/NBRStorageService?wsdl. I opened the file in SoapUI and used the "Check WSI Compliance" option and it passed all of the checks. Here are my errors: zeep

Creating XML sequences with zeep / python

有些话、适合烂在心里 提交于 2019-12-12 16:44:40
问题 I am using zeep (Python 3.6) to interface with a SOAP API, and working with a WSDL schema which contains this section: <xs:element name="passengers"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="passenger" type="com:PassengerType"/> </xs:sequence> </xs:complexType> </xs:element> So I'd like my zeep-generated XML to look like this: <book:passengers> <book:passenger> ...redacted... </book:passenger> </book:passengers> My first attempt at achieving this with Zeep looked

creating any object with python zeep

风流意气都作罢 提交于 2019-12-11 17:25:36
问题 i am pretty new to zeep, and soap. i`am trying to make client request to soap ws function. wsdl of function: -<s:element name="GetRetailTransactions"> -<s:complexType> -<s:sequence> -<s:element name="parameters" maxOccurs="1" minOccurs="0"> -<s:complexType mixed="true"> -<s:sequence> <s:any/> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element> i dont fully understand how to create object with type any in zeep. i have tried : wsdl = 'http://domain/app.asmx

how to specify xsi:type zeep python

荒凉一梦 提交于 2019-12-11 15:17:01
问题 Im using zeep SOAP client for python, trying to get some data to some wsdl_address. i now have following: ambCase = {'data1':'value1', 'data2':'value2'} client = zeep.Client(wsdl=WSDL_Address) result = client.service.MethodName(GUID, {'CaseDto':ambCase}) where ambCase is data i want to get to the server. MethodName method requires 2 parameters: GUID token(which works no problem), and ambCase object with specified xsi:type attribute(in my case it should be 'CaseAmb'), and i can't get it to

python soap zeep module get result

爷,独闯天下 提交于 2019-12-11 04:56:02
问题 I'm getting a result from a SOAP API like that: client = zeep.Client(wsdl=self.wsdl, transport=transport) auth_header = lb.E("authenticate", self.login()) res = client.service.GetHouseProfile(region_id, page_number, reporting_period_id, _soapheaders=[auth_header]) now I need to parse res and to get a result. >>> dir(res) ['__class__', '__contains__', '__deepcopy__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__getitem__', '__hash__', '_

How to fix SSL issue SSL_CTX_use_certificate : ca md too weak on Python Zeep

杀马特。学长 韩版系。学妹 提交于 2019-12-10 20:49:47
问题 my code was working before until i got this error whenever i make SOAP requests to Frontierlink Web Service. File "/home/venv/lib/python2.7/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue raise exception_type(errors) OpenSSL.SSL.Error: [('SSL routines', 'SSL_CTX_use_certificate', 'ca md too weak')] Do i need to regenerate the pem file that im using to connect or the issue is on the .p12 file that i have used to generate the pem file? Let me know if you need more info

Unable to connect to SOAP API with proxy setting

断了今生、忘了曾经 提交于 2019-12-10 10:21:30
问题 I'm using requests and zeep library to connect to a server using SOAP API. If I manually set the internet proxy, I can connect. However, I intend to use proxy setting in my script to automate the process. I'm using the following block of code to do that, but I'm getting the error below. Can anyone pls help me where am I making the mistake? ConnectionError: HTTPSConnectionPool(host='xxxl.com', port=443): Max retries exceeded with url: /webservice.php?wsdl (Caused by NewConnectionError(':

Python - Zeep SOAP Complex Header

做~自己de王妃 提交于 2019-12-09 07:03:28
问题 I'd like to pass "Complex" Header to a SOAP service with zeep library Here's what it should look like <soapenv:Header> <something:myVar1>FOO</something:myVar1> <something:myVar2>JAM</something:myVar2> </soapenv:Header> I guess that I succeed in sending a header this way header = xsd.Element( '{http://urlofthews}Header', xsd.ComplexType([ xsd.Element( '{http://urlofthews}myVar1', xsd.String()), xsd.Element( '{http://urlofthews}myVar2', xsd.String()) ]) ) header_value = header(myVar1='FOO'