?wsdl 和?singleWsdl 参数有什么区别 [英] What is the difference between ?wsdl and ?singleWsdl parameters

查看:46
本文介绍了?wsdl 和?singleWsdl 参数有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的消息传递提供程序为我提供了两种不同类型的 WSDL 供我使用.

My messaging provider gives me two different kinds of WSDLs to use.

http://my.amazonaws.com:8000/webservice/?wsdl
http://my.amazonaws.com:8000/webservice/?singleWsdl

第一个是嵌入式 WSDL.不能用它来生成 WSDL2java 包和不能使用 JAX-WS 创建连接.

The first one is an embedded WSDL. Can NOT use it to generate WSDL2java packages and can NOT use JAX-WS to create a connection.

第二个是单一 WSDL.它可以使用 CXF 3.0 的 WSDL2java 生成 Java 包,并且可以使用 JAX-WS 创建连接.效果很好.

The second one is a single WSDL. It can generate Java packages with CXF 3.0's WSDL2java and can use JAX-WS to create a connection. It works very well.

请告诉我这两种 WSDL 之间的区别是什么.

Please let me know what is the difference between these two kinds of WSDLs.

推荐答案

在不知道这些链接返回什么的情况下,我们只能猜测,但这里有一些细节可能会对您有所帮助....

Without knowing what those links return we can only guess, but here are some details that might help you....

使用 ?wsdl 为 Web 服务端点添加后缀,为您提供一个 WSDL 文件.WSDL 可以由框架在运行时基于 Web 服务框架代码生成,也可以是服务器在指定 URL 参数时返回的实际物理文件.

Suffixing the web service endpoint with ?wsdl get's you a WSDL file. The WSDL can be generated by the framework at runtime based on the web service skeleton code or can be an actual physical file that the server just sends back when the URL parameter is specified.

WSDL 包含一个 XML 模式,可以在 WSDL 本身内部指定,也可以指定为由 WSDL 导入的单独文件.现在出现问题了...

The WSDL contains an XML Schema that can be specified either inside the WSDL itself or as separate files that are imported by the WSDL. And now a problem occurs...

某些 Web 服务存根生成器只能处理完整的 WSDL,其中包含 Schema.如果 WSDL 导入其他文件,则工具无法解析导入并失败.这使得 Web 服务难以使用,因为客户端在创建存根以与 Web 服务交互时遇到问题.以至于服务提供商要么使用实际的 WSDL 来响应 ?wsdl 请求,要么开始编写各种技巧和插件来使 Web 服务生成完整的 WSDL.

Some web service stub generators can only handle a full WSDL, with the Schema inside. If the WSDL imports other files the tools can't resolve the imports and fails. This made web services hard to consume because clients had issues creating stubs to interact with the web service. So much so that service providers either used an actual WSDL to respond to the ?wsdl request or started writing all sorts of hacks and plugins to make the web service generate the full WSDL.

但有些提供商甚至没有打扰,因此客户不得不编写 hacks 来解析 WSDL,或者他们必须下载所有文件,手动将它们组合成一个文件并使用它.

But some providers didn't even bother so clients had to write the hacks to parse the WSDL or they had to download all files, assemble them manually into a single file and use that instead.

随着时间的推移,人们认识到这是一个问题,并且框架已适应提供完整的 WSDL,而不是具有导入功能的框架.但这又产生了另一个问题.更改返回的 ?wsdl URL 可能会破坏围绕它创建的所有黑客,以解决导入问题.出于这个原因,选择了另一个约定来返回完整的 WSDL:?singleWsdl.

With time people recognized this as a problem and frameworks adapted to provide the full WSDL, not one with imports. But this generated another problem. Changing what the ?wsdl URL returned could break all those hacks created around it to fix the import problem. For this reason another convention was chosen to return the full WSDL: ?singleWsdl.

所以有些框架可以生成完整的 WSDL,有些框架通过导入生成,有些允许您指定实际的物理文件,有些支持 ?singleWsdl 约定,有些则不支持.与这个问题无关,但只是为了完成,还有一个 ?wsdl2 约定可以为您提供 WSDL 2.0 定义(?wsdl 为您提供 WSDL 1.1).有些框架支持 ?wsdl2,有些不支持.

So there are frameworks that generate a full WSDL, some that generate it with imports, some allow you to specify an actual physical file, some that support the ?singleWsdl convention, some that don't. Not relevant to this question, but just for completion, there is also a ?wsdl2 convention that get's you a WSDL 2.0 definition (?wsdl get you a WSDL 1.1). Some frameworks support ?wsdl2, some don't.

我的猜测是您遇到的问题是由 Schema 导入引起的,但如果没有 WSDL 本身,我无法判断.希望这些细节至少能帮助您更好地识别问题.

My guess is the issues you have are caused by Schema imports, but without the WSDLs themselves I can't tell. Hope at least that these details help you better identify the problem.

这篇关于?wsdl 和?singleWsdl 参数有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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