如何在多个Axis2 Web服务客户端之间共享代理对象? [英] how can I share proxy objects across multiple Axis2 web service clients?

查看:61
本文介绍了如何在多个Axis2 Web服务客户端之间共享代理对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个要从Java客户端访问的WCF服务.这些服务具有跨多个服务使用的一些复杂的数据协定.我希望能够生成客户端代码,从而使我可以在所有服务中共享从数据协定生成的对象.基本上,我希望能够从一项服务检索数据并将其传递给另一项服务.

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.

使用SvcUtil.exe在.NET中非常容易完成此操作,因此我认为必须有一种在Java中完成此操作的方法.我一直在使用Axis2来获得ws-security支持,但是我并没有致力于该工具.关于如何实现此目标的任何想法?

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?

推荐答案

找到答案,以防万一有人需要... Axis2 wsdl2java工具--unpack-classes(-u)开关将类移出已生成的类服务存根.

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.

示例命令行:

"C:\ Program Files(x86)\ Java \ axis2-1.5.1 \ bin \ wsdl2java.bat" -noBuildXML -u -uw -p org.sample -uri

"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

"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

这篇关于如何在多个Axis2 Web服务客户端之间共享代理对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆