通过python请求或urllib发送soap1.1请求

2024-10-05 17:26:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我知道有人读这篇文章的第一反应是说“啊,这是一个重复的请求”,但请相信我这不是。但我还是没能在堆栈中实现我想做的事情。在

我想将在SoapUI中看到的以下详细信息发送到给定的WSDL,要么通过urllib2发送,要么在通过Zeep和Suds不幸失败后使用以下设置发送请求

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:slab="http://m2.slab">
   <soapenv:Header/>
   <soapenv:Body>
      <slab:PLChecker>
         <!--Optional:-->
         <slab:request>
            <!--Optional:-->
            <slab:ServiceProviderReferenceNumber>?</slab:ServiceProviderReferenceNumber>
            <!--Optional:-->
            <slab:ServiceNumber>0235625452</slab:ServiceNumber>
         </slab:request>
      </slab:PLChecker>
   </soapenv:Body>
</soapenv:Envelope>

This is the SoapUI settings I've used

到目前为止,我已经尝试过httpbasic身份验证,但似乎我不知道如何创建一个具有正确的soap信封:

  • 编码
  • 用户名
  • 密码
  • 认证类型:无认证
  • WSS密码类型:密码文本

在此方面的任何帮助都将不胜感激。 这是我目前使用的代码。在

^{pr2}$

Tags: http密码类型堆栈requestbodyoptionalsoap