IBM Eclipse WSDL 编辑器:如何包含外部 wsdl/模式?
我正在尝试从自上而下的方法创建 Web 服务。我下载了 Eclipse 并使用其中的 WSDL gui 编辑器来构建我的 WSDL 文件。
我正在根据“模块”拆分我的服务。我添加到 WSDL 的类型都需要引用常见的内容,例如 PersonEntity、AddressEntity、States 枚举(简单类型)、Countrys 枚举(简单类型)和 AbstractEntity。由于这些项目都很常见,因此我创建了一个单独的 WSDL 文件(名为 Commons.wsdl),其中包含这些类型的类型信息。
我想将该 WSDL“导入”到我的其他 WSDL 文件中以供使用:
例如,我有一个名为 RegistrationEntity 的实体,它继承自 AbstractEntity,并包含 PersonEntity 和 AddressEntity。我不知道如何做到这一点...我看到 WSDL 规范有“导入”和“包含”,但不确定使用哪一个。另外,如何实际导入(或包含)Commons.wsdl 文件以便我可以使用其中定义的类型?
谢谢!
哦,我不确定是否应该将这些内容放在单独的 WSDL 中,而是另一种类型的文件(例如 xsd 或其他文件)中。我真的想遵循最佳实践,所以如果这是正确的方法,那么我宁愿这样做。
I am trying to create Web Services from the Top-Down approach. I downloaded Eclipse and am using the WSDL gui editor in it to build my WSDL files.
I am splitting up my Services based on "modules". The Types I am adding to the WSDLs all need to reference common stuff, such as PersonEntity, AddressEntity, States enumeration (simple type), Countries enumeration (simple type), and AbstractEntity. Since those items are all common I created a seperate WSDL file (named Commons.wsdl) that contains the type information for those types.
I want to "import" that WSDL into my other WSDL files to use:
For example, I have an entity named RegistrationEntity which inherits from AbstractEntity and contains a PersonEntity as well as an AddressEntity. I'm not sure how to do this... I saw that the WSDL spec has "import" and "include" and am not sure which one to use. Also, how do I actually import (or include) the Commons.wsdl file so that I can use the Types defined within it?
Thanks!
Oh, and I'm not sure if I'm supposed to stick this stuff in a seperate WSDL but another type of file such as an xsd or something. I really wanna follow best practices so if that's the proper way to do it then I'd rather do that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现我遇到的问题是我正在为我的公共资源创建一个 WSDL 文件并为此使用内联方案,而不是创建一个由我的其他 WSDL 导入的 XSD 文件。
因此,我只是创建了一个 Commons.XSD 作为我的“通用架构”。
I found out that the problem I had was I was creating a WSDL file for my commons and using an inline scheme for that, rather than creating an XSD file to be imported by my other WSDLs.
So instead I just created an Commons.XSD as my "Common Schema".