Wash_out 仅支持 WSSE(Web 服务安全)身份验证。
它看起来像这样:
<soap:Header>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2003/06/secext">
<wsse:UsernameToken wsu:Id="sample"
xmlns:wsu="http://schemas.xmlsoap.org/ws/2003/06/utility">
<wsse:Username>sample</wsse:Username>
<wsse:Password Type="wsse:PasswordText">oracle</wsse:Password>
<wsu:Created>2004-05-19T08:44:51Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
我相信,如果您使用的是wash_out,您可以获得类似这样的标题(我没有尝试过这段代码,我只是在看https://github.com/inossidabile/wash_out/blob/master/lib/wash_out /调度程序.rb
envelope = request.env['wash_out.soap_data'].values_at(:envelope, :Envelope).compact.first
header = envelope.values_at(:header, :Header).compact.first
userId = header.values_at(:userID, :UserID).compact.first
password = header.values_at(:password, :Password).compact.first