java中的动态代理soap web服务客户端? [英] dynamic proxy soap web service client in java?

查看:741
本文介绍了java中的动态代理soap web服务客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用soap-rpc Web服务,以便通过共享接口生成客户端?宁静的网络服务这样做,但基于肥皂呢?你是否总是必须使用像Axis或CXF这样的工具来生成你的存根和代理,或者有没有可以动态设置它的东西?

Is there any way to use soap-rpc web services such that the client is generated via a shared interface? Restful web services do it this way, but what about soap based? Do you always have to use a tool like Axis or CXF to generate your stubs and proxies, or is there something out there that will set it up dynamically?

谢谢。

编辑#1:

为了澄清,我正在寻找一些事情像这样:

To clarify, I'm looking to do something like this:

通用界面:

@WebService
public interface MyWebService {

   @WebMethod
   String helloWorld();
}

这个通用接口已经可以用来创建服务器端组件。我的问题是:可以在客户端使用这种类型的通用接口来生成动态代理吗? Restful Web服务就是这样做的(Restlets& CXF),似乎.Net世界有这个功能类型。

This common interface can already be used to create the server side component. My question is: can this type of common interface be used on the client side to generate dynamic proxies? Restful web services do it this way (Restlets & CXF) and it seems the .Net world has this type of functionality too.

推荐答案

我会看到这个JAX-WS教程对您的用途很有用:

I would see this tutorial of JAX-WS useful for your purposes:

在示例代码中,Web Services Client是通过添加注释 @WebServiceRef 来配置指向客户端实现类的WSDL位置的属性,并且不需要任何工具来从引用的Web Service访问这些内容。

In the example code the Web Services Client is configured by adding an annotation @WebServiceRef with a property pointing to the WSDL location to the client implementation class and no tools are needed to access the stuff from the Web Service that is referenced.

这是你希望拥有它的方式,还是这样做甚至回答了正确的问题?

Was this the way you would like to have it, or did this even answer to right question?

这篇关于java中的动态代理soap web服务客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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