如何将 SOAP 响应与架构相匹配

发布于 2024-07-15 09:43:45 字数 136 浏览 6 评论 0原文

您好,我正在尝试评估网络服务。 我正在使用 Axis API 来创建请求。 我发送带有一些攻击的请求,然后想要验证获得的对响应模式的响应。 我不太清楚如何才能实现这一目标。 有人可以帮助我实现这一目标,或者给我一些指示,让我有一些想法来实现这一目标。

Hi I am trying to evaluate a web service. I am using the Axis API to create the requests. I send requests with some attacks, and then want to validate the obtained response to the response schema. I don't have much idea as to how can I achieve this. Can some one help me to achieve this, or give me some pointers that would give me some idea to obtain this.

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

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

发布评论

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

评论(3

谎言 2024-07-22 09:43:46

如果您使用 Axis2 附带的 wsdl2java 工具,响应消息将被解组到生成的类,如果响应消息与 WSDL 生成的类不对应,您将收到错误。 所以通过这种方式你就有了一种隐式验证。

If you used the wsdl2java tool that comes with Axis2, the response message will be unmarshalled to the generated classes, and you will get an error if the reponse message does not correspond with the classes generated from the WSDL. So in this way you have a kind of implicit validation.

绮烟 2024-07-22 09:43:46

延斯·马丁是正确的。 如果您使用的是 Axis wsdl2java 生成的客户端,则您需要的所有验证都在幕后进行。 正在进行两种类型的验证:

  1. SOAP 有模式定义,并且响应必须是有效的 SOAP 响应,否则客户端将抛出异常。
  2. 用于生成客户端的 WSDL 描述了响应的 SOAP 信封中的内容。 如果您得到的响应不匹配,客户端将抛出异常。

如果您确实觉得有必要编写自己的 XML 解析器/验证器和 SOAP 处理程序,那么您就得靠自己了。

Jens-Martin is correct. If you're using the client generated by Axis wsdl2java, all the validation you need is happening behind the scenes. There are two kinds of validation going on:

  1. SOAP has a schema definition, and the response must be a valid SOAP response or the client will throw an exception.
  2. The WSDL you used to generate the client described what goes in the SOAP envelope of the response. If the response you get doesn't match, the client will throw an exception.

If you really feel compelled to write your own XML parser/validator and SOAP handler, you're on your own.

离笑几人歌 2024-07-22 09:43:46

尝试 SOAPUI。 它是一个非常强大的Web服务开源测试工具。 您可以构建测试套件、进行性能测试并指定自定义的验证标准。

Try SOAPUI. It is quite a powerful open source testing tool for web services. You can construct test suites, do performance testing, and specify customized validation criteria.

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