转换 WSDL 文件的格式(Java?)
我使用的系统(Salesforce)只能使用文档/文字包装的 WSDL 文件。但是,我的客户需要我连接生成其他格式 WSDL 文件(例如 RPC 文字或只是文档文字)的旧系统。因此,我经常收到“不友好”格式的 wsdl 文件,并且我花了很长时间试图将其硬塞成 Salesforce 可接受的格式。基本上,wsdl 中不能有外部引用,并且必须采用文档/文字包装。
所以...我在想解决这个问题的一个偷偷摸摸的方法可能是使用 Java 中的 wsdl (jax.ws),然后通过一次调用以编程方式从 Java 重新创建 wsdl。
这个问题以前解决过吗?如果不是,那么我走在正确的道路上吗?以前有人解决过这个 wsdl 转换问题吗?我认为 XSLT 可能可以为比我更聪明的人完成这项工作,但我必须用我的大脑来工作,并且它似乎决心尽可能少地学习 wsdls 来解决这个问题。
TLDR:我可以使用 java 使用/创建任意格式的 WSDL,这样我就可以以包装的文档/文字格式创建 WSDL,没有属性(而是元素)并且没有导入(输出应该是完全自包含的 WSDL)。
如果你能帮我解决这个问题,我就给你买披萨!这是正确的。我会通过电子邮件向您发送 papaJohn/Dominos/Pizzahut 优惠券(或者,如果您想给我您的家庭住址/电话号码,甚至可以打电话给您当地的披萨店并为您购买 - 但您可能不会)。
I work with a system (Salesforce) that can only consume document/literal wrapped WSDL files. However, my customers need me to connect with older systems that generate other formats of WSDL file (RPC literal for example or just doc literal). So I often receive wsdl files in 'unfriendly' formats and I have a Hell Of A time trying to shoehorn it into a format acceptable by Salesforce. Basically, there can be no external references in the wsdl and it must be doc/literal wrapped.
So... I was thinking that a sneaky way to solve this issue might be to consume the wsdl in Java (jax.ws) and then recreate the wsdl from Java programmatically with a single call.
Has this problem been solved before? If not, then am I on the right track? Has anyone solved this wsdl transformation issue before? I assume XSLT could probably do the job for a smarter man than myself, but I've got to work with the brain I was issued and it seems determined to learn the minimum possible about wsdls in order to solve this problem.
TLDR: can I consume/create arbitrary format WSDLs with java so I can create WSDLs in wrapped doc/literal format with no attributes (elements instead) and no imports (a completely self contained WSDL should be the output).
If you can help me solve this problem I will buy you a pizza! That's right. I'll email you a papaJohn/Dominos/Pizzahut coupon (or even call your local pizza joint and buy it for you if you want to give me your home address/phone number - which you probably don't).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可以建议一种方法,但您可能会发现它有帮助,也可能没有帮助。
Apache CXF 包含大量代码,用于构建基于 WSDL 的服务模型,然后另一方面基于该模型构建 WSDL。通过从该代码开始并尝试编写更多代码来映射模型,您可能会有所收获,以便获得您想要的 wsdl。
我非常有信心 JAX-WS 内置的任何内容都不会帮助您,但我肯定没有记住它。您还可以在 CXF 用户邮件列表中找到更深入的相关专业知识库。
I can suggest an approach, but you may or may not find it helpful.
Apache CXF includes a great deal of code for building a model of a service based on a WSDL and then on the other hand building a WSDL based on the model. You might get somewhere by starting with that code and trying to write more code to map the model so that you get the wsdl you want.
I'm tolerable confident that nothing built-in-to JAX-WS is going to help you here, but I surely don't have it memorized. You might also find a deeper pool of relevant expertise at the CXF user mailing list.