Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从工厂创建的对象python SUD中删除元素_Python_Xml_Soap_Suds - Fatal编程技术网

从工厂创建的对象python SUD中删除元素

从工厂创建的对象python SUD中删除元素,python,xml,soap,suds,Python,Xml,Soap,Suds,我想知道如何删除正在插入请求中的元素 from suds.client import Client client = Client('http://localhost/Service?wsdl') lookup = client.factory.create('ns3:retreive') lookup.person = 'Dave' 这是肥皂水产生的 <body> <retrieve> <random> <person&g

我想知道如何删除正在插入请求中的元素

from suds.client import Client

client = Client('http://localhost/Service?wsdl')

lookup = client.factory.create('ns3:retreive')
lookup.person = 'Dave'
这是肥皂水产生的

<body>
  <retrieve>
    <random>
      <person>Dave</person>
    </random>
  </retrieve>
<body>

如何删除随机元素?

以下是我如何从请求中删除元素(在本例中为entityType)的示例:

    # Remove entityType from the search input if it is None.  This is 
    # because if it is None, suds will insert an empty element 
    # (<entityType/>) into the request, which the server doesn't like.
    if searchInput.entityType.value == None:
        del searchInput.entityType