我正在使用ZappySys的SSIS PowerPack创建一个使用SOAP Web服务的SSIS包。 ZappySys有一个关于如何通过获取SoapUI生成的主体来构建SOAP请求的教程。以下是SoapUI生成的内容:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:xxx-xxxxxxxxx-xxxxxx-xxx:ZZZZ-ZZZZZZ">
<soap:Header>
<wsse:Security soap:mustUnderstand="true" 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">
<wsu:Timestamp wsu:Id="TS-999CBF85A26FC675D3148400614200053">
<wsu:Created>2017-01-09T23:55:42.000Z</wsu:Created>
<wsu:Expires>2017-01-09T23:56:42.000Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken wsu:Id="UsernameToken-999CBF85A26FC675D3148399868052714">
<wsse:Username>User</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">HashedPasswordGoesHere</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">HashedNonce</wsse:Nonce>
<wsu:Created>2017-01-09T21:51:20.527Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<urn:ZZZZZZ>
<MESSAGE_IN>?</MESSAGE_IN>
<PRODUCT_DATAs>
<!--Zero or more repetitions:-->
<PRODUCT_DATA>
<!--Optional:-->
<PRODUCT_ID>?</PRODUCT_ID>
<!--Optional:-->
<VISTA_CUST_NUM>?</VISTA_CUST_NUM>
</PRODUCT_DATA>
</PRODUCT_DATAs>
</urn:ZZZZZZ>
</soap:Body>
</soap:Envelope>
如果未设置“WSS TimeToLive”属性,则此请求将失败。如果将其设置为&gt; 0,则请求成功。查看SoapUI文档,它说如果设置了“WSS TimeToLive”属性,那么SoapUI会自动向请求添加一个元素,但是我找不到TimeToLive元素的语法/格式。
添加时间戳和Created和Expires元素似乎与请求是否失败无关。有谁知道如何在请求体中明确指定WSS TimeToLive?