简体   繁体   English

更改SOAP主体以进行python suds调用

[英]Change SOAP body for python suds call

We have a project that is using suds for some SOAP calls that has been working pretty well until today when I discovered suds is not parsing out the 'choice' objects from the imported wsdl. 我们有一个项目正在使用suds进行某些SOAP调用,直到今天我发现suds并未从导入的wsdl中解析出“ choice”对象时,该项目一直运行良好。 With this information, I've been trying to figure out a way to inject the xml required to make the call successful 有了这些信息,我一直在尝试寻找一种方法来注入使调用成功所需的xml。

I'm calling the suds client like so 我这样打电话给客户

self.client.service.retrieveService()

to which suds is making this style call 哪些肥皂水正在向此样式调用

    <SOAP-ENV:Envelope
      <SOAP-ENV:Header>
        <tns:wsHeader>
          <wss>
            <userName>xxx</userName>
            <password>xxx</password>
          </wss>
          <messageType/>
       </tns:wsHeader>
     </SOAP-ENV:Header>
     <ns1:Body>
       <ns0:retrieveServiceRequest/>
     </ns1:Body>
   </SOAP-ENV:Envelope>

I've used the suds factory and the wsdl to create the proper input, but I can't figure out how to pass something like this to the client to use for the body: 我已经使用suds工厂和wsdl来创建正确的输入,但是我不知道如何将这样的内容传递给客户端以用于主体:

   (retrieveServiceRequest){
     serialNumberWrapper =
      (serialNumberWrapper){
         serialNumber = "1234567890"
      }
   }

Note: I've also tried creating my own xml and using __inject, but suds didn't appear to do anything or give any feedback (self.client.last_sent() returns None). 注意:我也尝试过创建自己的xml并使用__inject,但是suds似乎并没有做任何事情或提供任何反馈(self.client.last_sent()返回None)。 I can provide the only parameter properly pulled from the wsdl for retrieveService to the client call and it will be added to the suds call. 我可以提供正确地从wsdl中检索到的唯一参数(用于retrieveService)到客户端调用,并将其添加到suds调用中。

Any advice at this point would be appreciated, Thanks! 在这一点上的任何建议,将不胜感激,谢谢!

So I continued to work at this since it was blocking some bug fixes. 因此,我继续进行此工作,因为它阻止了一些错误修复。 Replace suds with suds_jurko which is just a fork that is still being maintained. 将suds替换为suds_jurko,这只是一个仍在维护的叉子。

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

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