最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Remove namespace on request variables - Stack Overflow

programmeradmin4浏览0评论

Use spyne for create soap server. Create models and services. The request message of the sendDocument method is formed as follows. How to remove "efat" ns prefix from
variables in documentRequest.

   <soap:Envelope xmlns:soap="; 
      xmlns:efat=";>
       <soap:Header/>
       <soap:Body>
        <efat:documentRequest>
           <!--Optional:-->
          <efat:fileName>?</efat:fileName>
           <!--Optional:-->
         <efat:binaryData contentType="?">cid:973156330962</efat:binaryData>
         <!--Optional:-->
         <efat:hash>?</efat:hash>
       </efat:documentRequest>
     </soap:Body>
   </soap:Envelope>

My model class is here:

   from spyne import Unicode, ByteArray, ComplexModel, XmlAttribute, XmlData
   
   class Base64Binary(ComplexModel):
       __namespace__ = ''
       __type_name__ = "base64Binary"
       _type_info = [
           ('_value', XmlData(ByteArray)),
           ('contentType', XmlAttribute(
               Unicode.
                 customize(__namespace__='')))]

   class DocumentType(ComplexModel):
       __namespace__ = ""
       fileName= Unicode.customize(__namespace__=None)
       binaryData = Base64Binary.customize(__namespace__=None)
       hash = Unicode.customize(__namespace__=None)

   class DocumentReturnType(ComplexModel):
       __namespace__ = ""
       _type_info = [
           ('msg', Unicode),
           ('hash', Unicode)
          ]
发布评论

评论列表(0)

  1. 暂无评论