SearchCardsEx

Возвращает результат выполнения поискового запроса.

Запрос

POST /DocsVision/StorageServer/StorageServerService.asmx HTTP/1.1
Host: DOCSVISION_SERVER.COM
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://schemas.docsvision.com/Platform/2009-02-03/StorageServer/SearchCardsEx"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SearchCardsEx xmlns="http://schemas.docsvision.com/Platform/2009-02-03/StorageServer/">
      <sessionId>guid</sessionId>
      <search>string</search>
      <flags>int</flags>
      <parameters>string</parameters>
    </SearchCardsEx>
  </soap:Body>
</soap:Envelope>
Параметры
sessionId

Идентификатор пользовательской сессии

search

Поисковый запрос в виде xml-документ. Сформировать запрос можно, в том числе, утилитой "Docsvision Explorer" (входит в Resource Kit).

flags

Дополнительные флаг: 0 — отсутствует; 1- в search передан идентификатор сохранённого поискового запроса, а не его содержимое

parameters

Параметры запроса, если поисковый запрос использует их

Строка parameters должна соответствовать формату элемента MethodCall, приведенному в схеме ServerRequests.xsd:

<xsd:element name="MethodCall">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
        <xsd:complexType>
          <xsd:simpleContent>
            <xsd:extension base="xsd:string">
              <xsd:attribute name="Name" type="xsd:string" use="optional"/>
              <xsd:attribute name="Type" use="required">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="bool"/>
                    <xsd:enumeration value="byte"/>
                    <xsd:enumeration value="short"/>
                    <xsd:enumeration value="integer"/>
                    <xsd:enumeration value="long"/>
                    <xsd:enumeration value="single"/>
                    <xsd:enumeration value="double"/>
                    <xsd:enumeration value="decimal"/>
                    <xsd:enumeration value="uniqueidentifier"/>
                    <xsd:enumeration value="char"/>
                    <xsd:enumeration value="string"/>
                    <xsd:enumeration value="datetime"/>
                    <xsd:enumeration value="text"/>
                    <xsd:enumeration value="binary"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:attribute>
            </xsd:extension>
          </xsd:simpleContent>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="MethodName" type="xsd:string"/>
    <xsd:attribute name="ObjectName" type="xsd:string" use="optional"/>
  </xsd:complexType>
</xsd:element>

Ответ

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SearchCardsExResponse xmlns="http://schemas.docsvision.com/Platform/2009-02-03/StorageServer/">
      <cursorInfo>
        <ID>guid</ID>
        <PageCount>unsignedInt</PageCount>
        <RowCount>unsignedInt</RowCount>
        <FirstPage>string</FirstPage>
        <UsingCompression>boolean</UsingCompression>
      </cursorInfo>
    </SearchCardsExResponse>
  </soap:Body>
</soap:Envelope>

Ответ содержит список карточек. Серверный курсор будет открыт при необходимости.

Пример запроса

# Изменяем цель запроса в заголовке запроса
session.headers['SOAPAction'] = "http://schemas.docsvision.com/Platform/2009-02-03/StorageServer/SearchCardsEx"

# SOAP-сообщение
body = """<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SearchCardsEx xmlns="http://schemas.docsvision.com/Platform/2009-02-03/StorageServer/">
      <sessionId>6565c75b-298d-e511-9417-90e6ba57b9f8</sessionId>
      <search>&lt;Search CombineResults=&quot;OR&quot;&gt;&lt;AttributiveSearch&gt;&lt;CardTypeQuery CardTypeID=&quot;{00000000-0000-0000-0000-000000000001}&quot;&gt;&lt;SectionQuery Version=&quot;4300&quot; SectionTypeID=&quot;{00000000-0000-0000-0000-000000000002}&quot;&gt;&lt;ConditionGroup Alias=&quot;alias2&quot; Operation=&quot;OR&quot;&gt;&lt;Condition Alias=&quot;alias3&quot; ParameterAlias=&quot;paramalias1&quot; SystemField=&quot;true&quot; Parameter=&quot;true&quot; ParameterID=&quot;{5A3336D7-F7C6-45C9-8628-9714412ABD50}&quot; ParameterName=&quot;CardId&quot;&gt;&lt;Field FieldType=&quot;string&quot;&gt;InstanceID&lt;/Field&gt;&lt;Op&gt;EQ&lt;/Op&gt;&lt;Value&gt;&#39;&#39;&lt;/Value&gt;&lt;/Condition&gt;&lt;/ConditionGroup&gt;&lt;Options Limit=&quot;-1&quot;/&gt;&lt;/SectionQuery&gt;&lt;/CardTypeQuery&gt;&lt;/AttributiveSearch&gt;&lt;Scope/&gt;&lt;Params&gt;&lt;Param Alias=&quot;paramalias1&quot; Name=&quot;CardId&quot; Type=&quot;string&quot; Flags=&quot;0&quot; Value=&quot;&quot;/&gt;&lt;/Params&gt;&lt;/Search&gt;</search>
      <flags>0</flags>
      <parameters>&lt;MethodCall&gt;&lt;Parameter Name=&quot;paramalias1&quot; Type=&quot;uniqueidentifier&quot;&gt;B289C6D4-8A8F-E511-9417-90E6BA57B9F8&lt;/Parameter&gt;&lt;/MethodCall&gt;</parameters>
    </SearchCardsEx>
  </soap:Body>
</soap:Envelope>"""

# Отправляем SOAP-сообщение
response = session.post(url, data=body)

# Ответ SOAP
print(response.content)