Apache CXF :: wsdl2java忽略公共条目的目录配置
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Apache CXF :: wsdl2java忽略公共条目的目录配置,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2271字,纯文字阅读大概需要4分钟。
内容图文
![Apache CXF :: wsdl2java忽略公共条目的目录配置](/upload/InfoBanner/zyjiaocheng/678/d5610753618640878f6699c203f0b20c.jpg)
我正在使用Apache CXF 2.7.6 wsdl2java,看来该工具会忽略或无法找到公共目录条目.特别是我有以下< xs:import>在我的XSD文件之一中:
<xs:import namespace="http://www.ivoa.net/xml/STC/STCcoords/v1.10"/>
上面的目录文件条目无法正确解决以上问题:
<public publicId="http://www.ivoa.net/xml/STC/STCcoords/v1.10" uri="STCcoords-v1.10.xsd"/>
如果我更改< xs:import>通过添加schemaLocation属性,即将其更改为:
<xs:import namespace="http://www.ivoa.net/xml/STC/STCcoords/v1.10" schemaLocation="http://www.ivoa.net/xml/STC/STCcoords/v1.10/>
它可以解析文件,但是我的理解是这不是必须的,因为我不想编辑我提供的XSD.
无论使用OASIS XML格式还是TR9401格式,行为都是相同的.
解决方法:
我从Apache CXF用户邮件列表中得到的答复是XML Schema规范将这一点留给实现,因此不被视为错误.
主题here(帖子发布日期为2013年9月26日,位于第2页,我似乎无法直接提供指向该页面的链接).相关结论是here.
My thoughts on this:
1) According to the schema spec, if the schemaLocation hint isn’t
specified, it’s up to the application to figure out how to resolve it
if needed. Thus, I don’t really consider this a “bug”. We
specifically just use the information provided and is part of the
“compilation unit” (aka: wsdl).2) Personally, I think it’s pretty silly to NOT provide the
schemaLocation and would STRONGLY STRONGLY recommend adding it. The
only time I’ve ever seen it not specified is when importing schemas
that are also embedded in the same wsdl (so there isn’t a location).
When ever I see things like “up to the application” in specs, that, to
me, is an interoperability nightmare. Just specify it.3) That all said, the root issue would be in XmlSchema’s SchemaBuilder
class. If there isn’t a schemaLocation, it assumes it’s part of the
compilation unit it’s working on and continues. Doesn’t try to
resolve anything. If you want to pursue a patch or something, it
would be around 680 of SchemaBuilder.java. But even changing that MAY
require more support from CXF’s side to pre-populate the namespaces it
already knows to avoid it going off to the internet for them. Not
really sure.
因此,可以确认:
> Oracle Java 7附带的默认wsimport工具确实使用目录来解析导入语句,即使没有schemaLocation属性也是如此.
> Apache CXF 2.7.6 wsdl2java工具不使用目录来解析没有schemaLocation属性的导入语句
> Apache CXF社区并不将此视为错误.
内容总结
以上是互联网集市为您收集整理的Apache CXF :: wsdl2java忽略公共条目的目录配置全部内容,希望文章能够帮你解决Apache CXF :: wsdl2java忽略公共条目的目录配置所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。