我正在尝试调用 WSO2 ESB 中的安全代理服务。我关注了这个tutorial 。我已成功调用代理服务。我还在代理服务“Out”序列中收到了响应。但是当我将此响应发送回 SOAPUI 时。我面临某些问题。
我已经完成了教程中提到的所有配置。
第一种方法:
当我尝试发送请求并按以下方式定义“身份验证”属性时。其中我包括传出 WSS 和传入 WSS,首先 SoapUI 要求输入密码(密码是“wso2carbon”),然后显示错误。
错误:
Error Getting Response :null
第二种方式:
当我仅在“身份验证属性”中包含传出 WSS 时,SoapUI 不会要求输入密码,并且也会得到响应。但响应是加密的并且不包含我的结果。
回应:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsu:Timestamp wsu:Id="Timestamp-174" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Created>2015-02-18T16:18:38.284Z</wsu:Created>
<wsu:Expires>2015-02-18T16:23:38.284Z</wsu:Expires>
</wsu:Timestamp>
<xenc:EncryptedKey Id="EncKeyId-F8FEAAA25C72C38AF11424276318297215">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference>
<wsse:KeyIdentifier EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">a/jhNus21KVuoFx65LmkW2O/l10=</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>R4aI0V2uS7h64n7qEMwzvs6iFN9YCTM7iMW7N+L3IxMP+Z7R9wwzlJpJ4vE3+tunVZyqdHzuOxGP0b3LLhNUsc7ys9QByvJoID3RkfkBlSz4AstOffL4t4CKIepx4fGXccFj0cvKxDrv/4SNREO2cQsHtYnsl/LOktxsq3Cd3kc=</xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI="#EncDataId-177"/>
</xenc:ReferenceList>
</xenc:EncryptedKey>
<wsse11:SignatureConfirmation Value="ZhUpeBE6eupgRfq+ZBKCb7lvdNeSfC/XP+9q9pgr41u53oFa93+yJ0lM5E+nqlK/8NvW4We8RYUSLwNZiJZnZ5bHBXADR9+mGsWi+mGv2grpSNS1/x40bsTSfbe+YTL1azQQNrdyFUBZHazX9I6VXaau1rYS6Wak1MC7Ndtmas4=" wsu:Id="SigConf-175" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
<ds:Signature Id="Signature-176" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#Id-1240651390">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>E9q9gvsO64SKD7LFluO62pEpFIM=</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#Timestamp-174">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>Y8ICfco6fqwNx0SC6eVN+fWGo6M=</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#SigConf-175">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>VJe/lgh2CALKbFN1B+YKif6HJVM=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>FbmcmvnHalQH14UiN9m6sVNsFoy0/IAS5tsdg2hg7n5kxD/MiNz/MS9w/q0VESAT61eV4/u8p+ho
HP0ehudU2s+U/PjGNU2M2eG7hI4T43gfdXLaOOemv4LcOeJwLTTp0at2AC2CRexUNmUMQ1UhQsoU
qrDYb/fHh47p+sOkbGE=</ds:SignatureValue>
<ds:KeyInfo Id="KeyId-F8FEAAA25C72C38AF11424276318286212">
<wsse:SecurityTokenReference wsu:Id="STRId-F8FEAAA25C72C38AF11424276318286213" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:KeyIdentifier EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">a/jhNus21KVuoFx65LmkW2O/l10=</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</soapenv:Header>
<soapenv:Body wsu:Id="Id-1240651390" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<xenc:EncryptedData Id="EncDataId-177" Type="http://www.w3.org/2001/04/xmlenc#Content">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:Reference URI="#EncKeyId-F8FEAAA25C72C38AF11424276318297215"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>Jg/EODedQJtbgBYc7xUa86fAtgALcbsHoiwDLJkyoPLOq1+Se+A/HEQOnmYwJhl7prw7pVK0ap3N
4F3Yvw3gZu0cdS+AUEAikrUzYdMwJAbQ8BYGSqK5IFdHourk74cFsshMYaMLqkwIgN+ZvmPuHxI8
tZCv+DF0kHecsq7qLXIfjxvI87TNygkzaj9gOex/</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</soapenv:Body>
</soapenv:Envelope>
注意:
无论如何,ESB 日志中都没有错误。我正在使用 WSO2 ESB 4.8.1。和 SoapUI 5.0.0。如果您需要有关我的代理服务代码和我的请求的更多信息,它与教程中提到的完全相同。它工作得很好,因为 ESB 的顺序有响应。
问题:
我想了解两件事,首先为什么我的回复是加密形式以及如何解密它。 第二为什么当包含“Incoming WSS”时,根本没有响应?
最佳答案
我花了一段时间才发现从 SoapUI 4.5(有效)升级到 5.1.3(无效)后也出现了同样的问题。
此文件中存在错误: C:\Program Files\SmartBear\SoapUI-5.1.3\bin\soapui-errors.log
最简单的解决方法是:
- 转到 C:\Program Files\SmartBear\SoapUI-5.1.3\lib
- 重命名 wss4j-1.6.16.jar 到 wss4j-1.6.16.jar.old
- 将 SoapUI 4.5 的 wss4j-1.6.2.jar 从同一位置复制到此文件夹。
重新启动即可运行。
基于此链接的回答,感谢托尔斯滕为我指明了正确的方向: http://community.smartbear.com/t5/SoapUI-NG/SoapUI-4-5-difference-Getting-Error-getting-response-NULL/m-p/41816/highlight/true#M21455
关于encryption - 如何解密从 Soap UI 5.0.0 中的 WSO2 安全代理服务接收的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28582769/