简体   繁体   English

如何在多个Axis2 Web服务客户端之间共享代理对象?

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

I have several WCF services that I want to access from a Java client. 我有几个要从Java客户端访问的WCF服务。 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. 使用SvcUtil.exe在.NET中很容易做到这一点,因此我认为必须有一种在Java中完成此操作的方法。 I've been using Axis2 for it's ws-security support, but I'm not committed to that tool. 我一直在使用Axis2来获得ws-security支持,但是我并没有致力于该工具。 Any ideas on how I can accomplish this? 关于如何实现此目标的任何想法?

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. 找到答案,以防万一有人需要... Axis2 wsdl2java工具--unpack-classes(-u)开关将这些类移出了生成的服务存根。

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/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 “ 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM