简体   繁体   English

在服务器上部署Java Web服务

[英]Deploying a Java Web Service on a server

I have been asked to create a JAVAX-WS web service which basically performs some basic computation on the input to return the output. 我被要求创建一个JAVAX-WS Web服务,该服务基本上对输入执行一些基本计算以返回输出。 I also need to lookup some values from a database. 我还需要从数据库中查找一些值。

I am using this book : 我正在使用这本书:
Java Web Services: Up and Running Java Web Services:启动并运行

What I've done so far : 到目前为止,我所做的是
1. Created the main java program containing the methods that perform the computations. 1.创建了包含执行计算方法的主Java程序。
2. Used wsgen and wsimport to generate the various artifacts. 2.使用wsgenwsimport生成各种工件。
3. Used Endpoint to publish the service on localhost. 3.使用端点在本地主机上发布服务。
What I need to do : 我需要做的是
I need to get it running on something like a windows server for .NET services. 我需要让它在诸如.NET服务的Windows服务器上运行。 So that it can serve multiple machines. 这样它可以为多台机器服务。

I know next to nothing about web services and servers, and have just gone through the first chapter of the aforementioned book so far. 我对Web服务和服务器几乎一无所知,到目前为止,它还没有涉及到上述书的第一章。
From what all resources I've gone through I believe I could use GlassFish, but I don't know if it serves my purposes. 从我所经历的所有资源中,我相信我可以使用GlassFish,但是我不知道它是否符合我的目的。
So if anyone could point to some helpful resources for the same, it would be extremely helpful. 因此,如果有人可以指出一些有用的资源,那将是非常有帮助的。
PS : I have no idea about looking up the required values from the database, so please point to some resource for that as well. PS :我不知道要从数据库中查找所需的值,因此也请指向该资源。

Endpoint can also serve requests concurrently, you can enable thread pooling by creating a ThreadPoolExecutor and registering it with the endpoint. 端点还可以同时处理请求,可以通过创建ThreadPoolExecutor并将其注册到端点来启用线程池。 See Endpoint.setExecutor(Executor executor) 请参见Endpoint.setExecutor(执行器执行器)

If you want to deploy your Web Service on GlassFish you should change it into a WAR project, see http://docs.oracle.com/javaee/6/tutorial/doc/bnayl.html 如果要在GlassFish上部署Web服务,则应将其更改为WAR项目,请参见http://docs.oracle.com/javaee/6/tutorial/doc/bnayl.html

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

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