简体   繁体   English

CXF和独立Web服务

[英]CXF and standalone web services

I'm currently writing a few applications that contain web service clients and servers, as complete standalone applications, eg without any web application server / servlet engine. 我目前正在编写一些包含Web服务客户端和服务器的应用程序,作为完整的独立应用程序,例如,没有任何 Web 应用程序服务器/ Servlet引擎。 I'm using plain Java 6, and for the "server" part I'm using the sun HttpServer. 我使用的是普通Java 6,对于“服务器”部分,我使用的是sun HttpServer。 Working like a charm. 像魅力一样工作。

(actually I am using CXF, but only for their wsdl2java tool, which is more flexible than the one that ships with Java 6). (实际上,我正在使用CXF,但仅用于其wsdl2java工具,它比Java 6附带的工具更灵活)。

I've been wondering now if there is any benefit for me to look at frameworks like CXF. 我一直在想,看看像CXF这样的框架是否对我有好处? Strangely enough, I can't find any information on the CXF web site on such a scenario, they just seem to blindly assume that everybody uses an applications server (and worse, maven). 奇怪的是,在这种情况下,我无法在CXF网站上找到任何信息,他们似乎只是盲目地假设每个人都在使用应用程序服务器(更糟糕的是,Maven)。

One of the reasons why I'm looking at CXF is that in the near future I expect that I need to support AIX as well, and there I can't use: 我之所以选择CXF的原因之一是,在不久的将来,我希望我也需要支持AIX,而在这里我不能使用:

reqcontext.put(BindingProviderProperties.CONNECT_TIMEOUT, connect_timeout);
reqcontext.put(BindingProviderProperties.REQUEST_TIMEOUT, request_timeout);

CXF has this thing called an HTTPClientPolicy which would nicely fit the bill. CXF拥有一个称为HTTPClientPolicy的东西,可以很好地满足要求。

Does anybody have any links to articles discussing using CXF without any application server / servlet engine? 没有任何应用服务器/ servlet引擎,是否有人链接到讨论使用CXF的文章? Are there any other benefits that CXF could give me over the current Java 6 JAX-WS implementation? 与当前的Java 6 JAX-WS实现相比,CXF还可以给我带来其他好处吗?

Maarten 马腾

Almost all the samples that come in the CXF distribution are setup specifically as a "main method" type service that starts up the service and clients and such as standalone applications without any use of an app server (or even Tomcat). 几乎所有CXF发行版本中的示例都被专门设置为“主要方法”类型的服务,该服务启动服务和客户端以及诸如独立的应用程序,而无需使用任何应用程序服务器(甚至Tomcat)。 The CXF samples would be a good place to start. CXF样本将是一个不错的起点。

That said, they do all use Maven now. 也就是说,他们现在都使用Maven。 :-) :-)

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

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