how can I share proxy objects across multiple Axis2 web service clients?

落花浮王杯 提交于 2019-12-12 02:58:32

问题


I have several WCF services that I want to access from a Java client. The services have some complex data contracts used across multiple services. I want to be able to generate client code that will allow me to share the objects generated from the data contracts across all the services. Basically I want to be able to retrieve data from one service and pass it to another.

This was pretty easy to accomplish in .NET using SvcUtil.exe, so I'm thinking there has to be a way to do it in Java. I've been using Axis2 for it's ws-security support, but I'm not committed to that tool. Any ideas on how I can accomplish this?


回答1:


Found the answer, in case anyone needs it... The Axis2 wsdl2java tool --unpack-classes (-u) switch moves the classes out of the generated service stub.

example command line:

"C:\Program Files (x86)\Java\axis2-1.5.1\bin\wsdl2java.bat" -noBuildXML -u -uw -p org.sample -uri http://localhost/SampleWcfServiceApp/Service1.svc?wsdl

"C:\Program Files (x86)\Java\axis2-1.5.1\bin\wsdl2java.bat" -noBuildXML -u -uw -p org.sample -uri http://localhost/SampleWcfServiceApp/Service2.svc?wsdl



来源:https://stackoverflow.com/questions/2210310/how-can-i-share-proxy-objects-across-multiple-axis2-web-service-clients

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!