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

查看:351
本文介绍了?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....

为Web服务端点添加?wsdl后,将为您提供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服务存根生成器只能使用Schema来处理完整的WSDL.如果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.

但是有些提供程序甚至没有打扰,因此客户端必须编写hack来解析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.但这产生了另一个问题.更改返回的?wsdl URL的内容可能会破坏围绕它创建的所有hack,以解决导入问题.因此,选择了另一个约定来返回完整的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天全站免登陆