A modern/fast python SOAP client based on lxml / requests

Overview

Zeep: Python SOAP client

A fast and modern Python SOAP client

Highlights:
  • Compatible with Python 3.6, 3.7, 3.8 and PyPy
  • Build on top of lxml and requests
  • Support for Soap 1.1, Soap 1.2 and HTTP bindings
  • Support for WS-Addressing headers
  • Support for WSSE (UserNameToken / x.509 signing)
  • Support for asyncio using the httpx module
  • Experimental support for XOP messages

Please see for more information the documentation at http://docs.python-zeep.org/

Status

https://readthedocs.org/projects/python-zeep/badge/?version=latest http://codecov.io/github/mvantellingen/python-zeep/coverage.svg?branch=master

Installation

pip install zeep

Note that the latest version to support Python 2.7, 3.3, 3.4 and 3.5 is Zeep 3.4, install via pip install zeep==3.4.0

Usage

from zeep import Client

client = Client('tests/wsdl_files/example.rst')
client.service.ping()

To quickly inspect a WSDL file use:

python -m zeep <url-to-wsdl>

Please see the documentation at http://docs.python-zeep.org for more information.

Support

If you want to report a bug then please first read http://docs.python-zeep.org/en/master/reporting_bugs.html

Please only report bugs and not support requests to the GitHub issue tracker.

Comments
  • Impossible to initialize async instance if loop currently running

    Impossible to initialize async instance if loop currently running

    1. The version of zeep (or if you are running master the commit hash/date) zeep==1.1.0
    2. The WSDL you are using https://webservices2.autotask.net/ATServices/1.5/atws.asmx?WSDL
    3. An example script

    Without sensetive data

    import asyncio
    
    loop = asyncio.get_event_loop()
    
    async def func():
        def start_client():
            session = aiohttp.ClientSession(
                auth=aiohttp.BasicAuth(
                    login='login',
                    password='password'
                ),
                loop=loop
            )    # loop is running -> no warnings
    
            transport = zeep.asyncio.AsyncTransport(
                loop=loop,
                cache=zeep.cache.InMemoryCache(),
                session=session
            )
    
        client = zeep.Client(
            wsdl=wsdl,
            transport=transport
        )
    

    Caused:

    lib/python3.5/site-packages/zeep/asyncio/transport.py", line 45, in _load_remote_data
        self.loop.run_until_complete(_load_remote_data_async())
      File "uvloop/loop.pyx", line 1198, in uvloop.loop.Loop.run_until_complete (uvloop/loop.c:25480)
      File "uvloop/loop.pyx", line 1191, in uvloop.loop.Loop.run_until_complete (uvloop/loop.c:25324)
      File "uvloop/loop.pyx", line 1100, in uvloop.loop.Loop.run_forever (uvloop/loop.c:24056)
      File "uvloop/loop.pyx", line 355, in uvloop.loop.Loop._run (uvloop/loop.c:11384)
    RuntimeError: this event loop is already running.
    

    Solution:

    if self.loop.is_running():
        # here we should call synchronous API (requests)
        # it may look like ugly, but currently it's only one solution
    else:
        self.loop.run_until_complete(
            _load_remote_data_async()
        )
    
    enhancement help wanted component/async 
    opened by penguinolog 18
  • WSDL service element should be optional

    WSDL service element should be optional

    Using zeep, I can't parse the ONVIF devicemgmt.wsdl file:

    python -m zeep http://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl
    
    zeep.exceptions.XMLParseError: References from this schema ('http://www.onvif.org/ver10/schema') to components in the namespace 'http://www.w3.org/2001/XMLSchema' are not allowed, since not indicated by an import statement.
    

    I'm pretty sure the ONVIF spec uses valid WSDL/XML.

    bug component/xsd 
    opened by mattpepin 18
  • getting python objects (list, dict) instead of zeep.objects in the result?

    getting python objects (list, dict) instead of zeep.objects in the result?

    Hello

    Is it possible to get the results as python types like dict and list instead of zeep.objects ? Or is there an easy way to transform them?

    Thanks

    opened by YAmikep 18
  • Arrays in the Request

    Arrays in the Request

    I'm having problems formatting a request that contains an array of input messages... when the renderer hits an array it doesn't add each element of the array to the soap message - and it throws an exception because the sub_value is None... getattr() returns None because it's looking for the element name - but the value is an array. I'm working with the types and elements source trying to debug it - not sure if it's a problem with the code or with the way I'm building the request message.

    Exception:

    <type 'exceptions.TypeError'>, TypeError("'NoneType' object is not iterable",), None
    

    At: elements.py:

       def render(self, parent, value):
              for val in value:
                node = etree.SubElement(parent, self.qname)
                self.type.render(node, val)
    

    Code I'm using to populate the soap request:

            api_client = Client(api_address_setting.setting_value + 'GetEntityWebService.asmx?WSDL')
            search_parameter_type = api_client.get_type('ns1:EntitySearchParameter')
            search_parameter = search_parameter_type()
            search_parameter.FieldName = 'Id'
            search_parameter.FieldValue = '0'
            search_parameter.Operator = 'GreaterThan'
            entity_search_clause_type = api_client.get_type('ns1:EntitySearchClause')
            entity_search_clause = entity_search_clause_type()
            entity_search_clause.Operator = 'And'
            entity_search_clause.SearchParameters = []
            entity_search_clause.SearchParameters.append(search_parameter)
            entity_request_type = api_client.get_type('ns1:EntityRequest')
            entity_request = entity_request_type()
            entity_request.EntityType = 'Staff'
            entity_request.EntitySearchClauses = [];
            entity_request.EntitySearchClauses.append(entity_search_clause)
            entity_request.RequestId = 0
            entity_msg_type = api_client.get_type('ns1:GetEntityInMsg')
            entity_msg = entity_msg_type()
            entity_msg.CorrelationId = -1
            entity_msg.CustomAttributes = []
            entity_msg.Entity = entity_request
            entity_msg.MessageId = -1
            entity_msg.RowCount = 0
            entity_msg.SkipSemanticValidation = False
            staff_req_type = api_client.get_type('ns1:GetEntityRequest')
            staff_req = staff_req_type()
            staff_req.TokenId = tokenId
            staff_req.Entities = []
            staff_req.Entities.append(entity_msg)
            staff_result = api_client.service.GetEntity(staff_req)
    

    Sample soap message that works (from a .net client):

    <GetEntityRequest xmlns="http://www.companyname.com/Soa/Foundation/MessageDefinition.xsd">
      <TokenId>2KVFvpE... etc...</TokenId>
      <Entities>
        <GetEntityInMsg>
          <Entity>
            <RequestId>0</RequestId>
            <EntityType>Staff</EntityType>
            <EntitySearchClauses>
              <SearchParameters>
                <FieldName>Id</FieldName>
                <FieldValue>0</FieldValue>
                <Operator>GreaterThan</Operator>
              </SearchParameters>
              <Operator>And</Operator>
            </EntitySearchClauses>
          </Entity>
        </GetEntityInMsg>
        <GetEntityInMsg>
          <Entity>
            <RequestId>1</RequestId>
            <EntityType>Campus</EntityType>
            <EntitySearchClauses>
              <SearchParameters>
                <FieldName>Id</FieldName>
                <FieldValue>0</FieldValue>
                <Operator>GreaterThan</Operator>
              </SearchParameters>
              <Operator>And</Operator>
            </EntitySearchClauses>
          </Entity>
        </GetEntityInMsg>
      </Entities>
    </GetEntityRequest>
    

    Here's the wsdl:

    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.company.com/Soa/Foundation/" xmlns:s1="http://www.company.com/Soa/Foundation/MessageDefinition.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://www.company.com/Soa/Foundation/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.company.com/Soa/Foundation/">
          <s:import namespace="http://www.company.com/Soa/Foundation/MessageDefinition.xsd" />
          <s:element name="GetSearchableAttributes">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" ref="s1:GetSearchableAttributeRequest" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="GetSearchableAttributesResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" ref="s1:GetSearchableAttributeResponse" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="RequestHeader" type="tns:RequestHeader" />
          <s:complexType name="RequestHeader">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="Headers" type="tns:ArrayOfAnyType" />
            </s:sequence>
            <s:anyAttribute />
          </s:complexType>
          <s:complexType name="ArrayOfAnyType">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="unbounded" name="anyType" nillable="true" />
            </s:sequence>
          </s:complexType>
          <s:element name="ResponseHeader" type="tns:ResponseHeader" />
          <s:complexType name="ResponseHeader">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="Headers" type="tns:ArrayOfAnyType" />
            </s:sequence>
            <s:anyAttribute />
          </s:complexType>
          <s:element name="GetEntity">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" ref="s1:GetEntityRequest" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="GetEntityResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" ref="s1:GetEntityResponse" />
              </s:sequence>
            </s:complexType>
          </s:element>
        </s:schema>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.company.com/Soa/Foundation/MessageDefinition.xsd">
          <s:element name="GetSearchableAttributeRequest" type="s1:GetSearchableAttributeRequest" />
          <s:complexType name="GetSearchableAttributeRequest">
            <s:complexContent mixed="false">
              <s:extension base="s1:GenericRequest">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="1" name="GetSearchableAttributes" type="s1:ArrayOfGetSearchableAttributeInMsg" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:complexType name="GenericRequest">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="TokenId" type="s:string" />
            </s:sequence>
          </s:complexType>
          <s:complexType name="ArrayOfGetSearchableAttributeInMsg">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="unbounded" name="GetSearchableAttributeInMsg" nillable="true" type="s1:GetSearchableAttributeInMsg" />
            </s:sequence>
          </s:complexType>
          <s:complexType name="GetSearchableAttributeInMsg">
            <s:complexContent mixed="false">
              <s:extension base="s1:GenericInMsg">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="1" name="BusinessEntityType" type="s:string" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:complexType name="GenericInMsg">
            <s:complexContent mixed="false">
              <s:extension base="s1:GenericMsg">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="1" name="MessageState" type="s:string" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:complexType name="GenericMsg">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" default="-1" name="MessageId" type="s:int" />
              <s:element minOccurs="0" maxOccurs="1" name="CustomAttributes" type="s1:ArrayOfCustomAttributeMsg" />
              <s:element minOccurs="0" maxOccurs="1" default="-1" name="CorrelationId" type="s:int" />
              <s:element minOccurs="0" maxOccurs="1" default="false" name="SkipSemanticValidation" type="s:boolean" />
            </s:sequence>
          </s:complexType>
          <s:complexType name="ArrayOfCustomAttributeMsg">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="unbounded" name="CustomAttributeMsg" nillable="true" type="s1:CustomAttributeMsg" />
            </s:sequence>
          </s:complexType>
          <s:complexType name="CustomAttributeMsg">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="Name" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="Value" type="s:string" />
            </s:sequence>
          </s:complexType>
          <s:complexType name="GenericOutMsg">
            <s:complexContent mixed="false">
              <s:extension base="s1:GenericMsg">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="1" name="MessageResult" type="s:string" />
                  <s:element minOccurs="0" maxOccurs="1" default="OK" name="MessageStatus" type="s1:MessageStatusType" />
                  <s:element minOccurs="0" maxOccurs="1" name="MessageErrorCode" type="s:string" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:simpleType name="MessageStatusType">
            <s:restriction base="s:string">
              <s:enumeration value="OK" />
              <s:enumeration value="FailedValidation" />
              <s:enumeration value="FailedExecution" />
              <s:enumeration value="FailedAuthorization" />
              <s:enumeration value="FailedOther" />
            </s:restriction>
          </s:simpleType>
          <s:complexType name="GetSearchableAttributeOutMsg">
            <s:complexContent mixed="false">
              <s:extension base="s1:GenericOutMsg">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="1" name="BusinessEntityType" type="s:string" />
                  <s:element minOccurs="0" maxOccurs="unbounded" name="SearchableAttributes" type="s1:CustomAttributeMsg" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:element name="GetSearchableAttributeResponse" type="s1:GetSearchableAttributeResponse" />
          <s:complexType name="GetSearchableAttributeResponse">
            <s:complexContent mixed="false">
              <s:extension base="s1:GenericResponse">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="1" name="GetSearchableAttributes" type="s1:ArrayOfGetSearchableAttributeOutMsg" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:complexType name="GenericResponse">
            <s:sequence>
              <s:element minOccurs="1" maxOccurs="1" name="Status" type="s1:TrxStatus" />
              <s:element minOccurs="0" maxOccurs="1" name="TrxResult" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="TokenId" type="s:string" />
            </s:sequence>
          </s:complexType>
          <s:simpleType name="TrxStatus">
            <s:restriction base="s:string">
              <s:enumeration value="OK" />
              <s:enumeration value="ErrorSQL" />
              <s:enumeration value="ErrorBusinessLogic" />
              <s:enumeration value="ErrorWebService" />
              <s:enumeration value="ErrorArguments" />
              <s:enumeration value="ErrorSecurity" />
              <s:enumeration value="ErrorSystem" />
              <s:enumeration value="ErrorMultiple" />
            </s:restriction>
          </s:simpleType>
          <s:complexType name="ArrayOfGetSearchableAttributeOutMsg">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="unbounded" name="GetSearchableAttributeOutMsg" nillable="true" type="s1:GetSearchableAttributeOutMsg" />
            </s:sequence>
          </s:complexType>
          <s:element name="GetEntityRequest" type="s1:GetEntityRequest" />
          <s:complexType name="GetEntityRequest">
            <s:complexContent mixed="false">
              <s:extension base="s1:GenericRequest">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="1" name="Entities" type="s1:ArrayOfGetEntityInMsg" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:complexType name="ArrayOfGetEntityInMsg">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="unbounded" name="GetEntityInMsg" nillable="true" type="s1:GetEntityInMsg" />
            </s:sequence>
          </s:complexType>
          <s:complexType name="GetEntityInMsg">
            <s:complexContent mixed="false">
              <s:extension base="s1:GenericInMsg">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="1" default="0" name="RowCount" type="s:int" />
                  <s:element minOccurs="0" maxOccurs="1" name="Entity" type="s1:EntityRequest" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:complexType name="EntityRequest">
            <s:complexContent mixed="false">
              <s:extension base="s1:EntityMsg">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="unbounded" name="EntitySearchClauses" type="s1:EntitySearchClause" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:complexType name="EntityMsg">
            <s:sequence>
              <s:element minOccurs="1" maxOccurs="1" name="RequestId" type="s:int" />
              <s:element minOccurs="0" maxOccurs="1" name="EntityType" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="EntityAssembly" type="s:string" />
            </s:sequence>
          </s:complexType>
          <s:complexType name="SerializedEntity">
            <s:complexContent mixed="false">
              <s:extension base="s1:EntityMsg">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="1" name="EntityString" type="s:string" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:complexType name="EntitySearchClause">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="unbounded" name="SearchParameters" type="s1:EntitySearchParameter" />
              <s:element minOccurs="1" maxOccurs="1" name="Operator" type="s1:ClauseOperatorType" />
              <s:element minOccurs="0" maxOccurs="unbounded" name="QueryFlags" type="s1:QueryFlagType" />
            </s:sequence>
          </s:complexType>
          <s:complexType name="EntitySearchParameter">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="FieldName" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="FieldValue" type="s:string" />
              <s:element minOccurs="1" maxOccurs="1" name="Operator" type="s1:ParameterOperatorType" />
            </s:sequence>
          </s:complexType>
          <s:simpleType name="ParameterOperatorType">
            <s:restriction base="s:string">
              <s:enumeration value="Equal" />
              <s:enumeration value="NotEqual" />
              <s:enumeration value="GreaterThan" />
              <s:enumeration value="GreaterThanOrEqual" />
              <s:enumeration value="LessThan" />
              <s:enumeration value="LessThanOrEqual" />
              <s:enumeration value="Like" />
              <s:enumeration value="IsNull" />
              <s:enumeration value="IsNullOrZero" />
              <s:enumeration value="IsNullOrEmptyString" />
              <s:enumeration value="IsNotNull" />
              <s:enumeration value="Between" />
              <s:enumeration value="In" />
              <s:enumeration value="NotIn" />
              <s:enumeration value="NotLike" />
              <s:enumeration value="BitWiseOR" />
              <s:enumeration value="BitWiseAND" />
              <s:enumeration value="NotBitWiseOR" />
              <s:enumeration value="NotBitWiseAND" />
            </s:restriction>
          </s:simpleType>
          <s:simpleType name="ClauseOperatorType">
            <s:restriction base="s:string">
              <s:enumeration value="And" />
              <s:enumeration value="Or" />
              <s:enumeration value="Undefined" />
            </s:restriction>
          </s:simpleType>
          <s:simpleType name="QueryFlagType">
            <s:restriction base="s:string">
              <s:enumeration value="CountAll" />
              <s:enumeration value="Distinct" />
            </s:restriction>
          </s:simpleType>
          <s:complexType name="ArrayOfGetEntityOutMsg">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="unbounded" name="GetEntityOutMsg" nillable="true" type="s1:GetEntityOutMsg" />
            </s:sequence>
          </s:complexType>
          <s:complexType name="GetEntityOutMsg">
            <s:complexContent mixed="false">
              <s:extension base="s1:GenericOutMsg">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="unbounded" name="SerializedEntities" type="s1:SerializedEntity" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
          <s:element name="GetEntityResponse" type="s1:GetEntityResponse" />
          <s:complexType name="GetEntityResponse">
            <s:complexContent mixed="false">
              <s:extension base="s1:GenericResponse">
                <s:sequence>
                  <s:element minOccurs="0" maxOccurs="1" name="EntityList" type="s1:ArrayOfGetEntityOutMsg" />
                </s:sequence>
              </s:extension>
            </s:complexContent>
          </s:complexType>
        </s:schema>
      </wsdl:types>
      <wsdl:message name="GetSearchableAttributesSoapIn">
        <wsdl:part name="parameters" element="tns:GetSearchableAttributes" />
      </wsdl:message>
      <wsdl:message name="GetSearchableAttributesSoapOut">
        <wsdl:part name="parameters" element="tns:GetSearchableAttributesResponse" />
      </wsdl:message>
      <wsdl:message name="GetSearchableAttributesRequestHeader">
        <wsdl:part name="RequestHeader" element="tns:RequestHeader" />
      </wsdl:message>
      <wsdl:message name="GetSearchableAttributesResponseHeader">
        <wsdl:part name="ResponseHeader" element="tns:ResponseHeader" />
      </wsdl:message>
      <wsdl:message name="GetEntitySoapIn">
        <wsdl:part name="parameters" element="tns:GetEntity" />
      </wsdl:message>
      <wsdl:message name="GetEntitySoapOut">
        <wsdl:part name="parameters" element="tns:GetEntityResponse" />
      </wsdl:message>
      <wsdl:message name="GetEntityRequestHeader">
        <wsdl:part name="RequestHeader" element="tns:RequestHeader" />
      </wsdl:message>
      <wsdl:message name="GetEntityResponseHeader">
        <wsdl:part name="ResponseHeader" element="tns:ResponseHeader" />
      </wsdl:message>
      <wsdl:portType name="GetEntityWebServiceSoap">
        <wsdl:operation name="GetSearchableAttributes">
          <wsdl:input message="tns:GetSearchableAttributesSoapIn" />
          <wsdl:output message="tns:GetSearchableAttributesSoapOut" />
        </wsdl:operation>
        <wsdl:operation name="GetEntity">
          <wsdl:input message="tns:GetEntitySoapIn" />
          <wsdl:output message="tns:GetEntitySoapOut" />
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="GetEntityWebServiceSoap" type="tns:GetEntityWebServiceSoap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="GetSearchableAttributes">
          <soap:operation soapAction="http://www.company.com/Soa/Foundation/GetSearchableAttributes" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
            <soap:header message="tns:GetSearchableAttributesRequestHeader" part="RequestHeader" use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
            <soap:header message="tns:GetSearchableAttributesResponseHeader" part="ResponseHeader" use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="GetEntity">
          <soap:operation soapAction="http://www.company.com/Soa/Foundation/GetEntity" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
            <soap:header message="tns:GetEntityRequestHeader" part="RequestHeader" use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
            <soap:header message="tns:GetEntityResponseHeader" part="ResponseHeader" use="literal" />
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:binding name="GetEntityWebServiceSoap12" type="tns:GetEntityWebServiceSoap">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="GetSearchableAttributes">
          <soap12:operation soapAction="http://www.company.com/Soa/Foundation/GetSearchableAttributes" style="document" />
          <wsdl:input>
            <soap12:body use="literal" />
            <soap12:header message="tns:GetSearchableAttributesRequestHeader" part="RequestHeader" use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
            <soap12:header message="tns:GetSearchableAttributesResponseHeader" part="ResponseHeader" use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="GetEntity">
          <soap12:operation soapAction="http://www.company.com/Soa/Foundation/GetEntity" style="document" />
          <wsdl:input>
            <soap12:body use="literal" />
            <soap12:header message="tns:GetEntityRequestHeader" part="RequestHeader" use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
            <soap12:header message="tns:GetEntityResponseHeader" part="ResponseHeader" use="literal" />
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="GetEntityWebService">
        <wsdl:port name="GetEntityWebServiceSoap" binding="tns:GetEntityWebServiceSoap">
          <soap:address location="http://10.0.1.5/WebServices/GetEntityWebService.asmx" />
        </wsdl:port>
        <wsdl:port name="GetEntityWebServiceSoap12" binding="tns:GetEntityWebServiceSoap12">
          <soap12:address location="http://10.0.1.5/WebServices/GetEntityWebService.asmx" />
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>
    
    requires/feedback 
    opened by bmiller264 17
  • Unable to remove tags

    Unable to remove tags

    Thank you for this much needed library.

    The issue I am finding is that Zeep is sending all the tags available for a specific method. The server will throw an exception unless certain tags are removed. I dig into the documentation and unable to know how or if this is possible with Zeep

    Zeep version 0.24

    WSDL

    https://gist.github.com/isidrov/24b73e5a8499f02d92c6f566148f3375

    Example script

    https://gist.github.com/isidrov/408ee6ba3914432287a0f235bdf50691

    What I am actually sending with current script

    https://gist.github.com/isidrov/047dace78d9e83ba337f602cf31b567f

    **What I need to send to make it work (confirmed by SOAPUI) **

    https://gist.github.com/isidrov/fd47320ac5312c707600db83d055b938

    Let me know if anything else is needed.

    Thanks!

    requires/example-script 
    opened by isidrov 16
  • nillable elements not serialized correctly

    nillable elements not serialized correctly

    Looks like there's an issue with nillable elements where objects that are None get converted to '' which then throws an error when being serialized. Given a message with either of these elements:

    <s:element minOccurs="1" maxOccurs="1" name="LongId" nillable="true" type="s:long"/>
    <s:element minOccurs="1" maxOccurs="1" name="DateOfBirth" nillable="true" type="s:dateTime"/>
    

    An error will be thrown as follows:

    zeep.exceptions.Fault: System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (1, 954). ---> System.FormatException: The string '' is not a valid AllXsd value.
       at System.Xml.Schema.XsdDateTime..ctor(String text, XsdDateTimeFlags kinds)
       at System.Xml.XmlConvert.ToDateTime(String s, XmlDateTimeSerializationMode dateTimeOption)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read10_NullableOfDateTime(Boolean checkType)
    

    I have not dug deeply into the issue but I would assume the same is the case for all types, not just those two.

    component/xsd requires/more-info 
    opened by wolfadactyl 14
  • Possible bug for schema elements without targetNamespace

    Possible bug for schema elements without targetNamespace

    I am trying to get a WSDL file from a 3rd party company to work. During parsing zeep fails to properly map some messages and therefore some operations (See details below). From what I can gather is that the main problem seems to be that the xsd:element for Add has no targetNamespace and when resolving zeep prefixes with the targetNamespace of wsdl:definitions: https://github.com/mvantellingen/python-zeep/blob/c39197853e681fea773d5f6265b5971cfdf879d7/src/zeep/wsdl/parse.py#L36-L43

    I am not sure if this is a bug in zeep or the WSDL, I can neither find a definitive answer in the XML Schema specs, nor in the WSDL ones. What I was able to find is from ws-i (http://www.ws-i.org/Profiles/BasicProfile-1.1.html#Schema_targetNamespace_Structure):

     R2105 All xsd:schema elements contained in a wsdl:types element of a DESCRIPTION MUST have a targetNamespace attribute with a valid and non-null value, UNLESS the xsd:schema element has xsd:import and/or xsd:annotation as its only child element(s). 
    

    But I do not know if the targetNamespace from the wsdl:definitions should get inherited. I'll happily try to code a patch in zeep if you think this is a bug in zeep.

    Version: zeep==3.1.0 WSDL: https://apolloner.eu/~apollo13/Calculator.wsdl Example Script:

    from lxml import etree
    from zeep import Client
    
    client = Client('https://apolloner.eu/~apollo13/Calculator.wsdl')
    
    node = client.create_message(client.service, 'Add', [], {'a': 3, 'b': 4})
    
    print(etree.tostring(node, pretty_print=True))
    

    Output:

    /home/florian/dev/bap/bap-services/.venv/lib/python3.6/site-packages/zeep/wsdl/wsdl.py:338: UserWarning: The wsdl:message for '{http://Example.org}ICalculator_Add_InputMessage' contains an invalid part ('parameters'): invalid xsd type or elements
      warnings.warn(str(exc))
    /home/florian/dev/bap/bap-services/.venv/lib/python3.6/site-packages/zeep/wsdl/wsdl.py:338: UserWarning: The wsdl:message for '{http://Example.org}ICalculator_Add_OutputMessage' contains an invalid part ('parameters'): invalid xsd type or elements
      warnings.warn(str(exc))
    /home/florian/dev/bap/bap-services/.venv/lib/python3.6/site-packages/zeep/wsdl/definitions.py:130: UserWarning: The wsdl:operation 'Add' was not found in the wsdl:portType '{http://Example.org}ICalculator'
      warnings.warn(str(exc))
    Forcing soap:address location to HTTPS
    Traceback (most recent call last):
      File "/home/florian/dev/bap/bap-services/.venv/lib/python3.6/site-packages/zeep/wsdl/definitions.py", line 149, in get
        return self._operations[key]
    KeyError: 'Add'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/florian/test.py", line 8, in <module>
        client.service, 'Add', [], {'a': 3, 'b': 4})
      File "/home/florian/dev/bap/bap-services/.venv/lib/python3.6/site-packages/zeep/client.py", line 131, in create_message
        operation_name, args, kwargs, client=self)
      File "/home/florian/dev/bap/bap-services/.venv/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", line 63, in _create
        operation_obj = self.get(operation)
      File "/home/florian/dev/bap/bap-services/.venv/lib/python3.6/site-packages/zeep/wsdl/definitions.py", line 151, in get
        raise ValueError("No such operation %r on %s" % (key, self.name))
    ValueError: No such operation 'Add' on {http://Example.org}DefaultBinding_ICalculator
    
    requires/feedback 
    opened by apollo13 13
  • Setting xsi:type attribute on

    Setting xsi:type attribute on "anyType" elements and adding xsi namespace to requests?

    Hello!

    I am currently trying to generate the proper XML format for a specific "Any Type" element within my requests using Zeep.

    The WSDL of this element is:

    <xs:complexType name="Property">
      <xs:attribute name="Name" type="xs:string" use="required"/>
      <xs:sequence>
        <xs:element minOccurs="0" name="Value" type="xs:anyType"/>
      </xs:sequence>
    </xs:complexType>
    

    I have verified that the proper working format (in the case where the value is a string) for the resulting XML is something like:

    <Property Name="details">
        <Value xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">Some Text</Value>
    </Property>
    

    I am however unable to ensure the xmlsn:xs and xsi:type attributes are present in the XML contents that Zeep generates.

    With many attempts, the closest I've been able to get was:

    <Property Name="details">
        <Value>Some Text</Value>
    </Property>
    

    I've been playing around with AnyObject, ComplexType, AnyType and other elements of the Zeep library without success.

    I am basically looking for pointers on how to properly add those two missing attributes to my Value element and how to properly add the "xsi" namespace to the SOAP envelope.

    Zeep version: 0.18.1, installed via pip

    Thank you.

    bug requires/feedback 
    opened by ginmrt 13
  • Force ns0 removal from envelope sent

    Force ns0 removal from envelope sent

    I'm having an issue when using zeep-python, the envelope sent has a bunch of ns0 added as namespacing.

    I tried using the etree.register_namespace() method but it doesn't seems to apply it to the envelope.

    I'm using fiddler to debug, so here's what doesn't work, and what's working :

    Not working:

    `

    <soap-env:Envelope xmlns:ns0="http://www.myurl.com/Integration/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> soap-env:Body ns0:GetList <ns0:entity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns0:Employee"> <ns0:ID xsi:nil="true"/> ns0:Deletefalse </ns0:entity> ns0:returnFullEntitiesfalse</ns0:returnFullEntities> </ns0:GetList> </soap-env:Body> </soap-env:Envelope> `

    Working :

    `

    <soap-env:Envelope xmlns="http://www.myurl.com/Integration/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> soap-env:Body false false </soap-env:Body> </soap-env:Envelope> `

    My python code

    ` from zeep import Client from zeep.transports import Transport from lxml import etree from xml.etree import ElementTree as etree

    transport = Transport(verify=False) wsdl = 'https://my.urlcom/Integration/?WSDL' #Private wsdl client = Client(wsdl, transport=transport) etree.register_namespace("", "http://www.myurl.com/Integration/") client.service.Login('username', 'password', 'schema', 'smtn', 'EN-US') #need to login (works with the ns0 added)

    DepartmentCls = client.get_type('ns0:Department') department = DepartmentCls() department["Delete"] = False resDepartments = client.service.GetList(department, False) #crashes `

    Here's the output :

    zeep.exceptions.Fault: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object. at PX.Api.ContractBased.Soap.EntityTransformExtension.AddListField(XmlDocument document, String entityType, FieldNode field, XmlNode fieldElementValue, XmlAttribute typeAttribute, XmlElement fieldElement) at PX.Api.ContractBased.Soap.EntityTransformExtension.AddFields(XmlDocument document, XmlNode entity, IEnumerable1 fields, String entityType) at PX.Api.ContractBased.Soap.EntityTransformExtension.TransformEntityNode(XmlDocument document, XmlNode entity, String parent, String fieldName, String type) at PX.Api.ContractBased.Soap.EntityTransformExtension.TransformInputMessage(XmlDocument document) at PX.Api.ContractBased.Soap.EntityTransformExtension.TransformInputMessage(XmlReader input, XmlWriter output, String oldNamespace, String newNamespace) at PX.Api.ContractBased.Soap.EntityTransformExtension.TransformSoapMessage(XmlReader input, XmlWriter output, String oldNamespace, String newNamespace, Action4 transformer) at PX.Api.ContractBased.Soap.EntityTransformExtension.ProcessMessage(SoapMessage message) at System.Web.Services.Protocols.SoapMessage.RunExtensions(SoapExtension[] extensions, Boolean throwOnException) at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() --- End of inner exception stack trace --- Process finished with exit code 1

    Any help would be appreciated

    requires/more-info 
    opened by wmehanna 13
  • Failure to parse WSDL

    Failure to parse WSDL "No definition" ... "found"

    1. The version of zeep (or if you are running master the commit hash/date)
        In [67]: zeep.__version__
        Out[75]: 
        '0.25.0'
    
    
    1. The WSDL you are using

    System.wsdl found in

    https://support.travelport.com/webhelp/uapi/Content/Resources/uAPI_WSDLschema_Release-V16.4.0.17.zip

    1. An example script
    import zeep
    
    c = zeep.Client('Release-V16.4.0.17-V16.4/system_v32_0/System.wsdl')
    
    
    $ python zeepfail.py
    Traceback (most recent call last):
      File "zeepfail.py", line 3, in <module>
        c = zeep.Client('Release-V16.4.0.17-V16.4/system_v32_0/System.wsdl')
      File "/fbpy/env/lib/python3.6/site-packages/zeep/client.py", line 100, in __init__
        self.wsdl = Document(wsdl, self.transport)
      File "/fbpy/env/lib/python3.6/site-packages/zeep/wsdl/wsdl.py", line 58, in __init__
        root_definitions.resolve_imports()
      File "/fbpy/env/lib/python3.6/site-packages/zeep/wsdl/wsdl.py", line 195, in resolve_imports
        binding.resolve(self)
      File "/fbpy/env/lib/python3.6/site-packages/zeep/wsdl/definitions.py", line 102, in resolve
        self.port_type = definitions.get('port_types', self.port_name.text)
      File "/fbpy/env/lib/python3.6/site-packages/zeep/wsdl/wsdl.py", line 175, in get
        raise IndexError("No definition %r in %r found" % (key, name))
    IndexError: No definition '{http://www.travelport.com/service/system_v32_0}SystemPingPortType' in 'port_types' found
    
    requires/feedback 
    opened by mattharrison 12
  • Arrays/sequences transferred incomplete (empty) to the server

    Arrays/sequences transferred incomplete (empty) to the server

    This issue is maybe somewhat releated to #145. However the former issue has already been closed so I hope you don't mind if I open a new one.

    I have currently the problem that arrays/sequences are sent empty to the server:

    WSDL (partly):

      <wsdl:message name="save_master_data">
        <wsdl:part name="atk" type="xsd:string">
        </wsdl:part>
        <wsdl:part name="type" type="xsd:string">
        </wsdl:part>
        <wsdl:part name="data" type="tns:masterObjectDataArray">
        </wsdl:part>
      </wsdl:message>
    
      <xs:complexType final="#all" name="masterObjectDataArray">
        <xs:sequence>
          <xs:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="tns:masterObjectData"/>
        </xs:sequence>
      </xs:complexType>
    
      <xs:complexType name="masterObjectData">
        <xs:sequence>
          <xs:element name="id" type="xs:long"/>
          <xs:element minOccurs="0" name="name" type="xs:string"/>
          <xs:element name="alive" type="xs:boolean"/>
          <xs:element minOccurs="0" name="custom" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>
    

    Method called:

    objects = [
     client.type_factory('ns0').masterObjectData(id=1, name="Object1", alive=true, custom=""),
     client.type_factory('ns0').masterObjectData(id=2, name="Object2", alive=true, custom=""),
     client.type_factory('ns0').masterObjectData(id=3, name="Object3", alive=true, custom="")
    ]
    client.save_master_data("foo", "bar", objects)
    

    Request beeing sent:

    <soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope">
      <soap-env:Body>
        <ns0:save_master_data xmlns:ns0="http://example">
          <atk>foo</atk>
          <type>bar</type>
          <data/>
        </ns0:save_master_data>
      </soap-env:Body>
    </soap-env:Envelope>
    

    Python Debug (generation of objects seems to be successfull):

    print(repr(objects))
    #==>
    [{
        'id': 1,
        'name': 'Object1',
        'alive': True,
        'custom': "" },
    {
        'id': 2,
        'name': 'Object2',
        'alive': True,
        'custom': "" },
    [...] ]
    

    Expected (afaik):

    <soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope">
      <soap-env:Body>
        <ns0:save_master_data xmlns:ns0="http://example">
          <atk>foo</atk>
          <type>bar</type>
          <data>
           <masterObjectData>
             <id>1</id>
             <name>Object1</name>
             <custom></custom>
           </masterObjectData>
            <masterObjectData>
              <id>2</id>
              <name>Object2</name>
              <custom></custom>
            </masterObjectData>
    [...]
          </data>
        </ns0:save_master_data>
      </soap-env:Body>
    </soap-env:Envelope>
    
    requires/example-script 
    opened by Flauschbaellchen 11
  • little curiosity

    little curiosity

    I was using ChatGPT to check a possibility using the Zeep library... And then I received the following responses:

    Screenshot from 2023-01-02 10-41-29 Screenshot from 2023-01-02 10-53-57 Screenshot from 2023-01-02 10-45-17 Screenshot from 2023-01-02 10-46-15

    I couldn't find anything about the real existence of this method... Did it really exist or does it exist?

    opened by arthoryuss 0
  • no generate <wsse:Nonce EncodingType

    no generate

    I am trying to consume a service, all the xml is generated correctly except this part, how can this tag be generated, thank you very much in advance

    timestamp_token = WSU.Timestamp() today_datetime = datetime.datetime.today() expires_datetime = today_datetime + datetime.timedelta(minutes = 5)

    timestamp_elements = [ WSU.Created(today_datetime.strftime("%Y-%m-%dT%H:%M:%SZ")), WSU.Expires(expires_datetime.strftime("%Y-%m-%dT%H:%M:%SZ")) ] timestamp_token.extend(timestamp_elements)

    user_name_token = UsernameToken('2-95','wzxxxxx',timestamp_token=timestamp_token) wsdl_client = Client( wsdl=wsdl_url, wsse=[user_name_token, signature], transport=transport )

    it generates:

    wsse:UsernameToken wsse:Username2-901705</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">wzPxxxx</wsse:Password> </wsse:UsernameToken> <wsu:Timestamp wsu:Id="id-1b7e34ff-0f38-4651-a456-8a4f4011903b"> wsu:Created2022-12-25T20:03:16Z</wsu:Created> wsu:Expires2022-12-25T20:08:16Z</wsu:Expires> </wsu:Timestamp>

    but the service expects this:

    <wsse:UsernameToken wsu:Id="UsernameToken-D01D11BA2CAF83D4FD16720147918422"> wsse:Username2-90155 </wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">wzxxxx</wsse:Password> <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">v47Jj/bIOMI5PIWFsdzalw==</wsse:Nonce> wsu:Created2022-12-26T00:33:11.842Z</wsu:Created> </wsse:UsernameToken>

    opened by yeramirez 0
  • cgi module removal

    cgi module removal

    DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13

    cgi is used here: https://github.com/mvantellingen/python-zeep/blob/4e5ebad9eb355281cf3ae73cf83f666dc4b8bb00/src/zeep/utils.py#L91-L94

    As a replacement of parse_header function PEP 594 suggests to use email.message.Message.

    opened by decaz 0
  • WSA plugin: allow custom prefix for MessageID.

    WSA plugin: allow custom prefix for MessageID.

    Fix #975

    Description

    When using the WSA plugin, the header's field MessageID is created as follows:

    <MessageID>urn:uuid:cb4dd644-d178-433d-9ec5-799e13407867</MessageID>
    

    Some endpoints require the urn: prefix to be absent:

    <MessageID>uuid:cb4dd644-d178-433d-9ec5-799e13407867</MessageID>
    

    This PR allows you to specify the prefix you want with the WSA plugin. For instance, this fixes the author's problem in issue #975:

    client = Client(
    'http://examples.python-zeep.org/basic.wsdl',
        plugins=[WsAddressingPlugin(message_id_prefix="uuid:")])
    
    opened by Merinorus 0
  • Fix to deserializer if result type does not have a length

    Fix to deserializer if result type does not have a length

    An exception will be thrown if a bool is returned from a SOAP service call. deserialize soap.py will ask for the length of the result body, but it may not be allowed to take len on some result body types. Added check if length is valid and returns the body directly if it is not. I haven't tested with any other types, such as integers.

    opened by holstebroe 0
  • Zeep does not correctly handle ONVIF WSDL

    Zeep does not correctly handle ONVIF WSDL

    Hello all,

    I am using zeep 4.2.0, with WSDL v1.1.

    I am attempting to implement ONVIF via zeep, but i am seeing many issues in the responses, they are either incomplete, incorrectly parsed or simply fail to work.

    Quick and easy examples to reproduce failure cases.

    python3.7 -m zeep https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl python3.7 -m zeep https://www.onvif.org/ver10/events/wsdl/event.wsdl python3.7 -m zeep https://www.onvif.org/ver20/media/wsdl/media.wsdl

    Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/dist-packages/zeep-4.2.0-py3.7.egg/zeep/__main__.py", line 92, in <module> main(args) File "/usr/local/lib/python3.7/dist-packages/zeep-4.2.0-py3.7.egg/zeep/__main__.py", line 87, in main client.wsdl.dump() File "/usr/local/lib/python3.7/dist-packages/zeep-4.2.0-py3.7.egg/zeep/wsdl/wsdl.py", line 124, in dump value = type_obj.signature(schema=self.types) File "/usr/local/lib/python3.7/dist-packages/zeep-4.2.0-py3.7.egg/zeep/xsd/types/complex.py", line 506, in signature part = element.signature(schema, standalone=False) File "/usr/local/lib/python3.7/dist-packages/zeep-4.2.0-py3.7.egg/zeep/xsd/elements/indicators.py", line 269, in signature value = element.signature(schema, standalone=False) File "/usr/local/lib/python3.7/dist-packages/zeep-4.2.0-py3.7.egg/zeep/xsd/elements/element.py", line 315, in signature value = self.type.signature(schema, standalone=False) File "/usr/local/lib/python3.7/dist-packages/zeep-4.2.0-py3.7.egg/zeep/xsd/types/complex.py", line 513, in signature value = ", ".join(parts) TypeError: sequence item 0: expected str instance, NoneType found

    Is there something wrong with ONVIF WSDL ? Am i doing something wrong ? or can zeep only handle very simply WSDL docs ???

    In my testing, suds works without issue, so zeep should be able to handle ONVIF aswell.

    opened by EmpireofKings 0
Releases(4.2.1)
  • 4.2.1(Nov 20, 2022)

  • 4.2.0(Nov 3, 2022)

    • Drop support for Python 3.6
    • Allow embedding CDATA elements in simple types (#1339)
    • Allow to pass in a pre parsed Document (#1330)
    • Fix httpx DeprecationWarning for post data (#1326)
    • Add BinaryMemorySignature (#1300)
    • Fix IndexError when empty body response (#1287)
    • Add support for context manager on Client (#1166)
    • Allow Ws Addressing plugin to use a different URL (#1328)
    • Accept strings for xsd base64Binary (#1072)
    Source code(tar.gz)
    Source code(zip)
  • 4.1.0(Aug 15, 2021)

    • Remove last dependency on six (#1250)
    • Use platformdirs instead of the appsdirs dependency (#1244)
    • Pass digest method when signing timestamp node(#1201)
    • Fix settings context manager when an exception is raised (#1193)
    • Don't render decimals using scientific notation (#1191)
    • Remove dependency on defusedxml (deprecated) (#1179)
    • Improve handling of str values for Duration (#1165)
    Source code(tar.gz)
    Source code(zip)
Owner
Michael van Tellingen
:collision:
Michael van Tellingen
Python requests like API built on top of Twisted's HTTP client.

treq: High-level Twisted HTTP Client API treq is an HTTP library inspired by requests but written on top of Twisted's Agents. It provides a simple, hi

Twisted Matrix Labs 553 Dec 18, 2022
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie

HTTPie: human-friendly CLI HTTP client for the API era HTTPie (pronounced aitch-tee-tee-pie) is a command-line HTTP client. Its goal is to make CLI in

HTTPie 25.4k Jan 1, 2023
Small, fast HTTP client library for Python. Features persistent connections, cache, and Google App Engine support. Originally written by Joe Gregorio, now supported by community.

Introduction httplib2 is a comprehensive HTTP client library, httplib2.py supports many features left out of other HTTP libraries. HTTP and HTTPS HTTP

null 457 Dec 10, 2022
A toolbelt of useful classes and functions to be used with python-requests

The Requests Toolbelt This is just a collection of utilities for python-requests, but don't really belong in requests proper. The minimum tested reque

null 892 Jan 6, 2023
Asynchronous Python HTTP Requests for Humans using Futures

Asynchronous Python HTTP Requests for Humans Small add-on for the python requests http library. Makes use of python 3.2's concurrent.futures or the ba

Ross McFarland 2k Dec 30, 2022
🔄 🌐 Handle thousands of HTTP requests, disk writes, and other I/O-bound tasks simultaneously with Python's quintessential async libraries.

?? ?? Handle thousands of HTTP requests, disk writes, and other I/O-bound tasks simultaneously with Python's quintessential async libraries.

Hackers and Slackers 15 Dec 12, 2022
A Python obfuscator using HTTP Requests and Hastebin.

?? Jawbreaker ?? Jawbreaker is a Python obfuscator written in Python3, using double encoding in base16, base32, base64, HTTP requests and a Hastebin-l

Billy 50 Sep 28, 2022
Single-file replacement for python-requests

mureq mureq is a single-file, zero-dependency replacement for python-requests, intended to be vendored in-tree by Linux systems software and other lig

Shivaram Lingamneni 267 Dec 28, 2022
r - a small subset of Python Requests

r a small subset of Python Requests a few years ago, when I was first learning Python and looking for http functionality, i found the batteries-includ

Gabriel Sroka 4 Dec 15, 2022
Requests + Gevent = <3

GRequests: Asynchronous Requests GRequests allows you to use Requests with Gevent to make asynchronous HTTP Requests easily. Note: You should probably

Spencer Phillip Young 4.2k Dec 30, 2022
EasyRequests is a minimalistic HTTP-Request Library that wraps aiohttp and asyncio in a small package that allows for sequential, parallel or even single requests

EasyRequests EasyRequests is a minimalistic HTTP-Request Library that wraps aiohttp and asyncio in a small package that allows for sequential, paralle

Avi 1 Jan 27, 2022
Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Paweł Piotr Przeradowski 8.6k Jan 4, 2023
A next generation HTTP client for Python. 🦋

HTTPX - A next-generation HTTP client for Python. HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support

Encode 9.8k Jan 5, 2023
Asynchronous HTTP client/server framework for asyncio and Python

Async http client/server framework Key Features Supports both client and server side of HTTP protocol. Supports both client and server Web-Sockets out

aio-libs 13.1k Jan 1, 2023
Aiosonic - lightweight Python asyncio http client

aiosonic - lightweight Python asyncio http client Very fast, lightweight Python asyncio http client Here is some documentation. There is a performance

Johanderson Mogollon 93 Jan 6, 2023
A minimal HTTP client. ⚙️

HTTP Core Do one thing, and do it well. The HTTP Core package provides a minimal low-level HTTP client, which does one thing only. Sending HTTP reques

Encode 306 Dec 27, 2022
An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie

HTTP Prompt HTTP Prompt is an interactive command-line HTTP client featuring autocomplete and syntax highlighting, built on HTTPie and prompt_toolkit.

HTTPie 8.6k Dec 31, 2022
Fast HTTP parser

httptools is a Python binding for the nodejs HTTP parser. The package is available on PyPI: pip install httptools. APIs httptools contains two classes

magicstack 1.1k Jan 7, 2023
Python package for caching HTTP response based on etag

Etag cache implementation for HTTP requests, to save request bandwidth for a non-modified response. Returns high-speed accessed dictionary data as cache.

Rakesh R 2 Apr 27, 2022