我正在尝试在WSO2 ESB中调用安全代理服务。我遵循了这个tutorial。我已经成功调用了代理服务。我也收到了我的代理服务“出”序列的响应。但是,当我将此响应发送回SOAPUI时。我面临某些问题。
我已经完成了本教程中提到的所有配置。
第一种方法:
当我尝试发送请求并通过以下方式定义“身份验证”属性时。在其中我同时包含传出WSS和传入WSS的情况下,First 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的顺序不正确。
问题:
我想了解两件事,第一,为什么我的回复采用加密形式,以及如何解密。
第二,为什么在包含“传入的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复制到此文件夹。


重新启动即可使用。

基于此链接的答案,请相信Thorsten为我指出了正确的方向:
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/

10-13 03:18