- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在开发一个 JAX-WS Web 服务,它必须根据 XML 数字签名规范验证传入的 SOAP 消息。我注意到一个奇怪的行为,我可以验证第一条传入消息,但随后的消息(签名和引用)验证失败。如果我重新启动应用程序服务器(Websphere 8.5),我可以验证第一条消息。似乎应用程序服务器在我解析传入的 SOAP 消息之前对其进行了修改。修改后的 SOAP 消息在逻辑上是等效的 XML 文档,但其物理表示不同,并且规范化并不能解决问题。
下面是从 SOAPMessageContext 检索 SOAPMessage 并打印信封的代码。
@Override
public boolean handleMessage(SOAPMessageContext messageContext) {
// get the message from the context
SOAPMessage message = messageContext.getMessage();
// is an outgoing message?
Boolean isOutgoing = (Boolean) messageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
if(!isOutgoing){
// incoming message...
// Retrieve the SOAP part of the incoming message
SOAPPart soapPart = message.getSOAPPart();
try {
System.out.println(soapPart.getEnvelope().toString());
} catch (SOAPException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//...omissis...
}
}
以下是第一条消息的输出:
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<CommandMessage xmlns="http://www.cryptomathic.com/ckms">
<Commands Count="1">
<PushServerPublicKeyCommand>
<SerialNumber>10</SerialNumber>
<Target>COPS</Target>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyValue>
<RSAKeyValue>
<Modulus>nnVA6qE9XnEtZPDLrtmWYfyh7nSC6R0543mwWoPFR+JtnRb6kQUXzf8fYaqyUFb3WD+57d1a9OxCzXLW4ilhe+QjrSy7zfqEQWTxkf+ajUuH3q3V/EpWqJvz4zwcxdTOkseap7skMh+zTacmViKAOm2oZAca3HQ2RwSiaYpiOTLAijnvPXieGGxBau8tlfyXZ8c+3TSRBevuiVT9Q5xBph+iT+Kk0Ay1762M3NoPJYAF3zUoaRZ95HqzmE0uuX/fJ4OAju87uvSD7V5uRW5L1LQ6vESIExZ3XmmCc6zOPSIiwBc3z+E6OZiIxoHw068qyNCdNk184X0rtw2ccl3nyQ==</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
</KeyValue>
</KeyInfo>
</PushServerPublicKeyCommand>
</Commands>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>XKl5mK5WVr1RU95Zui14kVz4Bpo=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>NFakMv6OTJIDJowl2SabGmxSii55OuxLUoJcEIURVZKf4aqoeC03aKSY42agOnUep/Ov7ijF5rLOfrxdDsqT5TCYGaSNEaviR4LnCxFjZ5DJKHCNFuCvRQGTEKgzQFqxh9T7RpvyzuN0dh3WJvhCLMYGGZTmFqSpCpcpEU0pCcKO0U+VlwVGVK8eFrKxKYj+uo/y2p1KLpOl+BfdM/caUZ93CIS7AHgwABhQg0uW5Bg/3nuYnmtpHpoGgco0Ds+LTlUFmvInaCn8TK4tVe3TZB8s4bMnBLY1ztut4xdLL4OPRUyryV+r67H2oFnsfGrQ/GMstdcnYaM8GHm9EycjCg==</SignatureValue>
<KeyInfo>
<KeyValue>
<RSAKeyValue>
<Modulus>nnVA6qE9XnEtZPDLrtmWYfyh7nSC6R0543mwWoPFR+JtnRb6kQUXzf8fYaqyUFb3WD+57d1a9OxCzXLW4ilhe+QjrSy7zfqEQWTxkf+ajUuH3q3V/EpWqJvz4zwcxdTOkseap7skMh+zTacmViKAOm2oZAca3HQ2RwSiaYpiOTLAijnvPXieGGxBau8tlfyXZ8c+3TSRBevuiVT9Q5xBph+iT+Kk0Ay1762M3NoPJYAF3zUoaRZ95HqzmE0uuX/fJ4OAju87uvSD7V5uRW5L1LQ6vESIExZ3XmmCc6zOPSIiwBc3z+E6OZiIxoHw068qyNCdNk184X0rtw2ccl3nyQ==</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
</KeyValue>
</KeyInfo>
</Signature>
</CommandMessage>
</soap:Body>
这是后续消息的输出:
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<CommandMessage xmlns="http://www.cryptomathic.com/ckms" xmlns:ns2="http://www.w3.org/2000/09/xmldsig#">
<Commands Count="1">
<PushServerPublicKeyCommand>
<SerialNumber>10</SerialNumber>
<Target>COPS</Target>
<ns2:KeyInfo>
<ns2:KeyValue>
<ns2:RSAKeyValue>
<ns2:Modulus>nnVA6qE9XnEtZPDLrtmWYfyh7nSC6R0543mwWoPFR+JtnRb6kQUXzf8fYaqyUFb3WD+57d1a9OxCzXLW4ilhe+QjrSy7zfqEQWTxkf+ajUuH3q3V/EpWqJvz4zwcxdTOkseap7skMh+zTacmViKAOm2oZAca3HQ2RwSiaYpiOTLAijnvPXieGGxBau8tlfyXZ8c+3TSRBevuiVT9Q5xBph+iT+Kk0Ay1762M3NoPJYAF3zUoaRZ95HqzmE0uuX/fJ4OAju87uvSD7V5uRW5L1LQ6vESIExZ3XmmCc6zOPSIiwBc3z+E6OZiIxoHw068qyNCdNk184X0rtw2ccl3nyQ==</ns2:Modulus>
<ns2:Exponent>AQAB</ns2:Exponent>
</ns2:RSAKeyValue>
</ns2:KeyValue>
</ns2:KeyInfo>
</PushServerPublicKeyCommand>
</Commands>
<ns2:Signature>
<ns2:SignedInfo>
<ns2:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ns2:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ns2:Reference URI="">
<ns2:Transforms>
<ns2:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ns2:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ns2:Transforms>
<ns2:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ns2:DigestValue>XKl5mK5WVr1RU95Zui14kVz4Bpo=</ns2:DigestValue>
</ns2:Reference>
</ns2:SignedInfo>
<ns2:SignatureValue>NFakMv6OTJIDJowl2SabGmxSii55OuxLUoJcEIURVZKf4aqoeC03aKSY42agOnUep/Ov7ijF5rLOfrxdDsqT5TCYGaSNEaviR4LnCxFjZ5DJKHCNFuCvRQGTEKgzQFqxh9T7RpvyzuN0dh3WJvhCLMYGGZTmFqSpCpcpEU0pCcKO0U+VlwVGVK8eFrKxKYj+uo/y2p1KLpOl+BfdM/caUZ93CIS7AHgwABhQg0uW5Bg/3nuYnmtpHpoGgco0Ds+LTlUFmvInaCn8TK4tVe3TZB8s4bMnBLY1ztut4xdLL4OPRUyryV+r67H2oFnsfGrQ/GMstdcnYaM8GHm9EycjCg==</ns2:SignatureValue>
<ns2:KeyInfo>
<ns2:KeyValue>
<ns2:RSAKeyValue>
<ns2:Modulus>nnVA6qE9XnEtZPDLrtmWYfyh7nSC6R0543mwWoPFR+JtnRb6kQUXzf8fYaqyUFb3WD+57d1a9OxCzXLW4ilhe+QjrSy7zfqEQWTxkf+ajUuH3q3V/EpWqJvz4zwcxdTOkseap7skMh+zTacmViKAOm2oZAca3HQ2RwSiaYpiOTLAijnvPXieGGxBau8tlfyXZ8c+3TSRBevuiVT9Q5xBph+iT+Kk0Ay1762M3NoPJYAF3zUoaRZ95HqzmE0uuX/fJ4OAju87uvSD7V5uRW5L1LQ6vESIExZ3XmmCc6zOPSIiwBc3z+E6OZiIxoHw068qyNCdNk184X0rtw2ccl3nyQ==</ns2:Modulus>
<ns2:Exponent>AQAB</ns2:Exponent>
</ns2:RSAKeyValue>
</ns2:KeyValue>
</ns2:KeyInfo>
</ns2:Signature>
</CommandMessage>
</soap:Body>
我总是使用 SoapUI 发送相同的消息,但正如您所看到的,消息在逻辑上是等效的,但在物理上是不同的。我怎样才能避免这种行为?
问候,乔瓦尼
最佳答案
IBM 的以下文档描述了您遇到的问题以及解决方案:
关于java - JAX-WS、Websphere AS 8.5 和 XML 数字签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13642167/
我们正在构建一个以 Websphere 7 作为目标环境的 web 应用程序,它使用 CXF 连接到 web 服务。我们已经使用 Jetty 在本地完成了测试,一切顺利。我们现在正在尝试在 Websp
我是一名 Java 程序员,想要开始使用 Websphere 应用程序服务器。有人可以建议一些好的介绍吗?书籍/文章/链接等 最佳答案 IBM 的红皮书是很好的入门资源,还有另一篇关于 IBM 开发人
我试图在 Websphere LP server.xml 文件中映射我的服务器公共(public) IP 地址,但是当我尝试从外部访问它时,出现连接错误。我尝试给 host="localhost"并尝
我试图在 Websphere LP server.xml 文件中映射我的服务器公共(public) IP 地址,但是当我尝试从外部访问它时,出现连接错误。我尝试给 host="localhost"并尝
在将应用程序从单个 Websphere Application Server 迁移到 Websphere 集群之前,我们应该注意什么 最佳答案 这是我根据经验列出的 list 。它并不完整,但应涵盖最
我已经为 WebSphere 中的容器设置了一些自定义属性,但我不知道如何读取这些属性。我试过 System.getProperty(...),但它是空的。 我看过对 JMX 的引用,但想知道是否有明
我目前正在研究 IBM Websphere Application Server 和 IBM Websphere Process Server 之间的区别? 我知道 Process Server 就像
我正在处理一个应用程序,它需要知道它是在 WAS 上运行还是在 Liberty Profile 上运行。 在 WAS 上,它必须调用 Admin API,但在 Liberty Profile 上,它必
我很难解决“找不到委托(delegate)人...”的问题。我阅读了所有文章,但我已成功将 ear 文件安装到 WAS 8.5 中。 此应用程序要求最终用户进行 LDAP 身份验证才能登录。我的 LD
我正在开发许多用于管理 WAS 基础设施的脚本,我觉得 IBM 的某个人搞砸了 wsadmin故意。这不可能是意外。 这是一个“简单”的例子: for node in AdminConfig.list
我删除了 C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles 中的配置文件,它仍然显示在配置文件管理工具中,如何删除配置文件管理工具中的配置
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 8 年前。 Improv
我有一个 WebSphere 应用程序服务器 8,我在其中部署了一个企业应用程序。现在我想让该应用程序的 Web GUI 可以访问。因此,我设置了一个端口 (9080),添加了一个 Web 容器传输链
是否可以用 Weld 替换 WebSphere 8 的 CDI 提供程序 (OpenWebBeans)?如果做不到这一点,是否有任何方法可以在 WebSphere 中完全禁用 CDI? 我为什么需要这
我有一个带有@local 和@remote 注释的无状态EJB SessionBean。该代码在 weblogic 服务器中运行良好。但是,将其部署到 Websphere 时会出现以下异常。 bm.e
我们正在尝试安装 Websphere 应用程序服务器的补丁。但已经获得了 Websphere 商务服务器的说明。所以只是想知道两者是否相同并且可以应用相同的指令。 我们是否需要 root 访问权限来执
我已经安装了 WebSphere Liberty 配置文件 8.5 。我可以使用 http://localhost:9080 访问 WebSphere 服务器 但不确定如何启动 Admin Conso
我在 WebSphere 应用程序服务器上将一个依赖 jar 扔到我爆炸的 EAR 中。我需要停止/启动 EAR 才能让 WS 执行新代码。有没有办法从命令行执行此操作? 最佳答案 尝试运行这样的东西
我全新安装了 Wesphere 6.1 Fixpack 23。我部署了一个需要 MQSeries JMS 队列的应用程序。我设置了一个基于 MQSeries 提供者的请求和回复队列以及一个基于 MQS
session 超时后是否可以将用户带到自定义网页?在 websphere 中要设置的参数是什么? 最佳答案 我不知道 WAS 中有这样的设置。 我认为您最好的机会是实现 Filter这将检查 ses
我是一名优秀的程序员,十分优秀!