Java的。根据WSDL验证SOAP消息 [英] Java. Validate SOAP message against a WSDL

查看:62
本文介绍了Java的。根据WSDL验证SOAP消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要针对 WSDL 验证SOAP消息?
(就像 XML 文件可以针对 XSD 架构验证一样)。

I need to validate a SOAP message against a WSDL? (in the same way that an XML file can be validated against a XSD schema).

我没有打电话给任何网络服务;
我只有一个 SOAP 消息和一个 WSDL ,我需要验证 SOAP 消息是正确的。
没有调用webservice或之后的任何内容。

I am not calling any webservice; I just have a SOAP message and a WSDL, and I need to verify that the SOAP message is correct. without calling the webservice or whatsoever afterwards.

我需要在Java程序中进行此验证。
你知道一个小的Java库吗?

I need to make this validate within a Java program. Do you know of a small Java library to do this?

ps:我知道有几个 JAX-WS 库可以在您调用Web服务时验证请求/响应。但同样,我没有打电话给任何网络服务;我有一个简单的 SOAP 消息,以及一个 WSDL ,我需要一个验证<$ c $的函数c> SOAP 针对 WSDL的消息

ps: I am aware that several JAX-WS libraries can validate the request/response when you call a webservice. But again, I am not calling any webservice; I have a simple SOAP message, and a WSDL, and I a need a function that validates the SOAP message against the WSDL.

ps:我也知道有可以执行此操作的工具,例如 SOAPUI XMLSpy 。同样,我需要在我的Java程序中进行此验证。

ps: I am also aware that there tools that can do this, such as SOAPUI and XMLSpy. Again, I need to do this validation within my Java program.

ps:我知道我可以提取 SOAP <的正文部分/ code>消息,并根据 XSD 对其进行验证。但是,我想针对 WSDL 验证整个 SOAP 消息。

ps: I am aware that I could extract the body part of the SOAP message, and validate it against the XSD. However, I'd like to validate the entire SOAP message against the WSDL.

推荐答案

您可以查看开源soapUI项目中WsdlValidator类的源代码。

You might look at the source code for the WsdlValidator class in the open-source soapUI project.

https://github.com/SmartBear/soapui

http:// www .soapui.org / apidocs / com / eviware / soapui / impl / wsdl / support / wsdl / WsdlValidator.html

这篇关于Java的。根据WSDL验证SOAP消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆