如果我有 wsdl 文件而不生成存根 java 类,如何调用 web 服务? [英] How can I invoke web-service if I have wsdl file without generating stubs java classes?

查看:16
本文介绍了如果我有 wsdl 文件而不生成存根 java 类,如何调用 web 服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只有 wsdl 文件,我对其内容一无所知.我必须实现两个功能

I have only wsdl file and I know nothing about its content. I have to implement two features

  1. 获取有关 wsdl 文件中描述的所有网络服务(名称和参数)的详细信息
  2. 在不生成存根 Java 类的情况下调用 Web 服务.

推荐答案

您无需生成代码即可使用 JAX-WS 客户端 - example - 但你需要了解一些关于请求/响应形式的信息以调用服务并解释响应.

You don't need to generate code to use JAX-WS clients - example - but you'll need to know something about the form of the requests/responses in order to invoke the service and interpret the response.

WSDL 描述了 SOAP 有效负载的形式.SOAP 有效负载可以包含各种复杂的 XML 结构.服务可能能够在合同中描述它的所有约束,但可能有逻辑约束不是.您可以从 WSDL 推断出有限数量的事情.

The WSDL describes the form of the SOAP payloads. SOAP payloads can contain all sorts of complex XML structures. The service might be able to describe all its constraints in the contract, but there may be logical constraints that aren't. There are a finite number of things you can infer from the WSDL.

这篇关于如果我有 wsdl 文件而不生成存根 java 类,如何调用 web 服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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