首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spyne create answer

Spyne create answer
EN

Stack Overflow用户
提问于 2016-06-07 22:18:00
回答 1查看 126关注 0票数 0

对不起,我的英语不好。我不能理解SPYNE是如何响应发送他的请求的。客户端以此形式发送:

代码语言:javascript
复制
<SOAP-ENV: Envelope xmlns: ns0 = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: ns1 = "localhost" xmlns: xsi = "http://www.w3.org/2001/ XMLSchema-instance "xmlns: SOAP-ENV =" http://schemas.xmlsoap.org/soap/envelope/ ">
    <SOAP-ENV: Header />
    <Ns0: Body>
       <Ns1: prerender>
          <Ns1: secret> secret_key </ ns1: secret>
          <Ns1: requestId> 1 </ ns1: requestId>
          <Ns1: projectId> id1 </ ns1: projectId>
       </ Ns1: prerender>
    </ Ns0: Body>
</ SOAP-ENV: Envelope>

服务器响应如下:

代码语言:javascript
复制
<Soap11env: Envelope xmlns: soap11env = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: tns = "localhost">
   <Soap11env: Body>
     <Tns: prerenderResponse>
       <Tns: prerenderResult0> secret_key </ tns: prerenderResult0>
       <Tns: prerenderResult1> 1 </ tns: prerenderResult1>
     </ Tns: prerenderResponse>
   </ Soap11env: Body>
</ Soap11env: Envelope>

请告诉我如何生成这样的响应:

代码语言:javascript
复制
<SOAP-ENV:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:ns1="localhost" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/>
    <ns0:Body>
      <ns1:secret>INT</ns1:commandType>
      <ns1:requestId>STRING</ns1:secret_key>
      <ns1:projectId>INT</ns1:requestId>
    </ns0:Body>
  </SOAP-ENV:Envelope>

如果我从文档中理解的话。这是使用ComplexModel完成的。但是要实现这样的strukutru,我不能得到

EN

回答 1

Stack Overflow用户

发布于 2016-06-21 23:45:51

您可以使用@rpc(..., _out_variable_names=["foo", "bar"])更改标记名称prerenderResult0prerenderResult1

据我所知,在SOAP主体下有多个标记是不合法的。不过,您可以将ctx.out_document更改为您喜欢的任何内容。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37681897

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档