简体   繁体   English

如何为UTF-8编码Suds Jurko Python设置soap标头

[英]How to set soap header for UTF-8 encoding Suds Jurko Python

I am creating my own factory xml elements using client.factory.create 我正在使用client.factory.create创建自己的工厂xml元素

I have headers which I set prior to this using Attribute and Element then using client.set_options. 我有在此之前使用Attribute和Element然后使用client.set_options设置的标头。

But I have an issue with empty strings as they don't parse and i receive an error: 但是我有一个空字符串的问题,因为它们无法解析,并且收到错误消息:

   raise exception
xml.sax._exceptions.SAXParseException: <unknown>:28:64: not well-formed (invalid token)

I have googled and it seems I need to add the content type to the header. 我用谷歌搜索,似乎我需要将内容类型添加到标题中。 Please can someone show me how I can do this using: 请有人可以告诉我如何使用以下方法做到这一点:

request_header.append request_header.append

The result should look as follows: 结果应如下所示:

<?xml version="1.0" encoding="utf-8"?>

can you figure it from there? 你能从那里弄清楚吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM