Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
374 views
in Technique[技术] by (71.8m points)

python - Python Zeep Soap嵌套字典(Python Zeep soap nested dictionary)

I have a WSDL path as " http://xxxxxxxxxxxxxxx?WSDL ".

(我的WSDL路径为“ http:// xxxxxxxxxxxxxxx?WSDL ”。)

I use Python Zeep for using this.

(我使用Python Zeep来使用它。)

the code is:

(代码是:)

data = {
            'requestData': {
                'userid': self.user_id,
                'password': self.password,
                'action': self.action,
            },
            'body': {
                'type': 'x',
                'recipient':
                    {
                        'mobile': 'x',
                        'message': 'x',
                        'originator': 'x',
                        'senddate': '',
                        'type': b'251',
                        'name': 'test',
                    }
            }
        }

but when I try to use the service:

(但是当我尝试使用该服务时:)

result = client.service.XmsRequest(**data)

This raises an error:

(这引发了一个错误:)

ValueError: The String type doesn't accept collections as value

How can I use nested dictionaries in Zeep?

(如何在Zeep中使用嵌套词典?)

I've read this: https://python-zeep.readthedocs.io/en/latest/helpers.html but I couldn't use it for my code.

(我已经读过这篇文章: https : //python-zeep.readthedocs.io/en/latest/helpers.html,但是我无法在我的代码中使用它。)

Anybody knows how to use this type of nested dicts for zeep?

(有人知道如何将这种嵌套的字典用于zeep吗?)

Thanks

(谢谢)

  ask by Amin.B translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...