使用RPC /编码的Web服务的最佳方式是什么?
我需要为后端使用旧式RPC /编码的WSDL Web服务。起初我尝试使用Apache CXF和JAX-WS,但JAX-WS wsimport
工具不吃rpc / enoded WSDL。
I need to consume old-school RPC/encoded WSDL webservice for my backend. At first I tried to use Apache CXF and JAX-WS for that, but JAX-WS wsimport
tool doesn't eat rpc/enoded WSDL.
[错误] JAXWS 2.0不支持rpc / encoded wsdls。
[ERROR] rpc/encoded wsdls are not supported in JAXWS 2.0.
I'm also in doubt about using JAX-RPC for this job, because it's way out-dated. Axis 1.4 is 5 years old tool.
目前我看到这三个选项:
Currently I see these three options:
- 使用JAX-WS
javax.xml.ws.Dispatch
发送和接收SOAP并以某种方式解析它,一个例子 - 使用JAX-RPC并获得使用过时的恶误业力技术,
- 手动完成所有操作并稍后讨厌自己。
- use JAX-WS
javax.xml.ws.Dispatch
to send and receive SOAP and parse it somehow, one example - use JAX-RPC and gain bad karma for using outdated technology,
- do it all manually and hate myself later.
这些都听起来都不是好的,所以如果你能提供一些好的线索,想要做什么以及如何解决它,我将不胜感激。
Neither of these sound too good, so I would appreciate if you could give some good leads, thought what to do and how to solve it.
更新
我的案例是通过手工编辑从编码到文字的WSDL解决的(基本上在操作输入和输出 use =literal是唯一的替代品)然后我可以用 Apache CXF 生成存根。可以这样做,因为端点没有完全解析RPC /编码,并且无法针对WSDL验证RPC /编码规范XML。
UPDATE
My case was solved with hand editing WSDL from encoded to literal (basically under operations input and output use="literal"
was the only replacement) and then I could generate stubs with Apache CXF. It could be done, because endpoint wasn't parsing RPC/encoded exactly and RPC/encoded spec XML couldn't be validated against WSDL).
尽管Axis 1.4可能有效对于你来说,使用Apache CXF和那个小WSDL黑客,可能是一个更好的方法。
Although Axis 1.4 may work for you, using Apache CXF with that little WSDL hack, may be a better way.
作为参考 - 我这次选择使用JAX-RPC和Axis 1.4。我生成了客户端代码,并希望在服务升级时可以用JAX-WS实现替换它。
For reference -- I opted for using JAX-RPC and Axis 1.4 this time. I generated client code and hopefully can replace it with JAX-WS implementation when service gets upgraded.