如何在 JAX-WS CXF 处理程序中获取 SOAP 方法

发布于 2025-01-01 13:40:08 字数 201 浏览 3 评论 0原文

我正在编写一个处理程序,实现:

SOAPHandler<SOAPMessageContext>

我只想在某个 SOAP 调用上执行某些操作,但看起来处理程序整体附加到 Web 服务,而不是特定的方法。

那么,如何检查我的handleMessage代码中正在调用什么方法?

谢谢

I'm writing a handler, implementing:

SOAPHandler<SOAPMessageContext>

I only want to do something on a certain SOAP call, but it looks like the handler gets attached to the web service overall, rather than a specific method.

So, how to check what method is being called in my handleMessage code?

Thanks

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

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

发布评论

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

评论(1

归途 2025-01-08 13:40:08

好吧,看起来我找到了一种方法,不确定这是否是最好的方法,但它应该有效:

SOAPMessage message = smc.getMessage();
SOAPBody body = message.getSOAPBody();

//Then grabbing the first child node of the body and checking its name:
Iterator<Node> nodes = body.getChildElements();
// get the first one
if (n.getNodeName().equals("The node name for the particular operation")) {
 // then we have it
}

OK looks like I found a way, not sure if it's the best method but it should work:

SOAPMessage message = smc.getMessage();
SOAPBody body = message.getSOAPBody();

//Then grabbing the first child node of the body and checking its name:
Iterator<Node> nodes = body.getChildElements();
// get the first one
if (n.getNodeName().equals("The node name for the particular operation")) {
 // then we have it
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文