2

我有这样的要求:

<soapenv:Envelope xmlns:...>
   <soapenv:Header/>
   <soapenv:Body>
      <con:getRequest>
         <header requestId="?" usageMode="?">
            <systemName>?</systemName>
            <timestamp>?</timestamp>
            <userName>?</userName>
         </header>
         <body>
            <!--Optional:-->
            <fetchProperty>
               <!--1 or more repetitions:-->
               <propertyName>?</propertyName>
            </fetchProperty>
            <id>?</id>
         </body>
      </con:getRequest>
   </soapenv:Body>
</soapenv:Envelope>

我如何设置参数?

我设置了其他值,如下所示,但我不知道如何设置这些属性。

self.__client.service.get(
            header=dict(
            systemName=system_name,
            timestamp=datetime.date(2018, 04, 26),
            userName=system_username),
            body=dict(fetchProperty=dict(propertyName='ALL'), id=agreement_id)
        )

任何人都可以帮忙吗?

4

1 回答 1

1

解决了:

self.__client.get(
            header={
                'requestId':'123',
                'usageMode':'normal',
                'systemName': system_name,
                'timestamp': datetime.date(2018, 04, 26),
                'userName': system_username
            },
            body=dict(fetchProperty=dict(propertyName='ALL'), id=agreement_id)
        )

我不知道为什么如果我将这些参数放在 dict() 中它不起作用

于 2018-04-26T12:53:37.530 回答