使用 Metro 连接到 WCF 服务时出现问题 - HTTP 有效,HTTPS 无效

发布于 2025-01-07 02:00:37 字数 1245 浏览 0 评论 0原文

我正在使用我正在构建的 Java 客户端连接到 WCF Web 服务。其他人已经成功构建了 WCF 客户端来连接到此服务。通过 HTTP 提供的 WSDL 提供了消息级安全性。通过 HTTPS 提供的 WSDL 使用 TLS 和消息级安全性。据我所知,在消息级安全之上使用 TLS 基本上是双重加密,但这是一个关键要求。

由于我可以正确连接到 HTTP 服务,因此我相信我已经解决了所有信任存储和密钥存储问题。

我正在使用 Metro 2.1.1 连接到该服务。我已经在 Eclipse 和 Netbeans 中构建了客户端。我从 HTTP 站点获取 WSDL,并使用 wsimport(带有 -extensions 标志)成功构建并执行客户端。

当我使用 HTTPS 站点获取 WSDL 时,我可以再次成功构建两个客户端。但是,当我执行它们时,出现以下错误:

    Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: An error occurred when verifying security for the message.
at com.sun.xml.ws.fault.SOAP12Fault.getProtocolException(SOAP12Fault.java:225)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:122)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
at $Proxy43.request(Unknown Source)

两个 WSDL(一个通过 HTTP 获取,另一个通过 HTTPS 获取)之间的唯一区别是 WSDL 中对 HTTPS:// 与 HTTP:// 的引用。

我无法轻松访问 WCF 服务日志 - 通常在我请求一组日志和可以查看它们之间有 3-6 小时的延迟。

我的问题是有没有人遇到过类似的情况 - 是否有我在这里公然遗漏的东西?我可以在 NetMon 或 Wireshark 跟踪中查找某些内容来确定问题所在吗?我已经为此苦苦挣扎了好几天 - 任何帮助将不胜感激。

I am connecting to a WCF web service with a Java client I am constructing. Someone else has already successfully built WCF clients to connect to this service. The WSDL available via HTTP provides Message Level Security. The WSDL available via HTTPS uses both TLS and Message Level Security. I understand that using TLS on top of Message Level Security is basically dual-encrypting, but that is a key requirement.

Since I can connect to the HTTP service correctly, I believe I have all the trust store and key store issues resolved.

I am connecting to the service using Metro 2.1.1. I have built the client in both Eclipse and Netbeans. I fetch the WSDL from the HTTP site, and using wsimport (with the -extensions flag) I build and execute the clients successfully.

When I fetch the WSDL using the HTTPS site I can again build both clients successfully. But when I execute them - I get the following error:

    Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: An error occurred when verifying security for the message.
at com.sun.xml.ws.fault.SOAP12Fault.getProtocolException(SOAP12Fault.java:225)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:122)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
at $Proxy43.request(Unknown Source)

The only difference between the two WSDLs (the one fetched via HTTP and the other via HTTPS) is the reference in the WSDL to HTTPS:// vs. HTTP://.

I do not have easy access to the WCF service logs - normally there is a 3-6 hour delay between when I request a set of logs and when I can view them.

My question is has anyone encountered a similar circumstance - and is there something I am blatantly missing here? Is there something in a NetMon or Wireshark trace I can look for to see that the issue is? I have been struggling with this for days - any help would be most appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狠疯拽 2025-01-14 02:00:37

如果您有权访问服务配置,请尝试在您正在使用的端点上禁用安全上下文:

<message establishSecurityContext="False" clientCredentialType="UserName"/>

您可以阅读有关安全上下文令牌 (SCT) 的更多信息:

If you have access to the service configuration try disabling security context on the endpoint you're using:

<message establishSecurityContext="False" clientCredentialType="UserName"/>

You can read more about security context token (SCT):

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文