在这种情况下,SoapUI会修改传出的XML。它在
<env:Body>
元素,然后将其作为POST请求发送出去。
<env:Header>
<wsse:Security
env:mustUnderstand="1"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-86F2FCCEFFBB80C4CD14820998755791">
<wsse:Username>username@tenant</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
<wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">asdfwrqwarqwr1+oA==
</wsse:Nonce>
<wsu:Created>2016-12-18T22:24:30.575Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>
因此,我已经将其添加到原始XML中,并从请求中删除了基本的Auth头,它可以工作了。