Python zeep xsi:type="xsd:string"

问题描述 投票:0回答:1

我正在尝试制作正确的文档,但不起作用。我需要将“值”包装在 xsi:type="xsd:string"tag 中

请告诉我该怎么做) 谢谢你

...
from zeep import Client, Transport

...
# it's work

    def add_temp_person_identifier(self,
                                   person_session_id=None,
                                   person_id=None,
                                   access_group_id=None):
        if person_session_id is None:
            person_session_id = self.open_person_editing_session(person_id=person_id)['value']

        namespace = ''

        for key, value in self.client.namespaces.items():
            if value == "http://localsite.com/IntergationService":
                namespace = key
        IdentifierType = self.client.get_type(f"{namespace}:IdentifierTemp")

        Identifier = IdentifierType(CODE='0000',
                                    IS_PRIMARY=False,
                                    PERSON_ID=person_id,)
        result = self.client.service.AddPersonIdentifier(person_session_id, Identifier)
        self.close_person_editing_session(person_session_id)
        return result


# need help with it. "value" must be in xsi:type="xsd:string" tag

    def find_by_login(self, login):
        return self.client.service.PersonSearch(self.session_id,
                                                fieldID='0de358e0',
                                                relation=0,
                                                value=login)

我用谷歌搜索并阅读了说明,但我完全不知道如何正确遵循它。

python xsd zeep xsi
1个回答
0
投票
    def find_by_login(self, login):
    return self.client.service.PersonSearch(self.session_id,
                                            fieldID='43a278d1',
                                            relation=0,
                                            value=xsd.AnyObject(xsd.String(), login))
© www.soinside.com 2019 - 2024. All rights reserved.