0

我已经使用 JAX-WS API 创建了一个 WebService。该服务使用 Endpoint 类运行没有任何问题。

main(String args[])
{
(...)
MyService service=new MyService();
service.setParam1("limit=100");
service.setParam2("hello");
service.setParam3("max-value=10");
Endpoint endpoint = Endpoint.create(service);
endpoint.publish("http://localhost:8090/ws");
(...)
}

现在,我想在 glassfish 中部署这项服务。但是,正如我在示例中所写,我想使用一些参数来初始化我的服务。我怎样才能做到这一点?我应该使用其他 API 吗?

提前谢谢了

4

1 回答 1

0

好的,我终于找到了答案:使用javax.xml.ws.WebServiceContext是解决方案。查看其他答案如何从 JAX-WS Web 服务中访问 ServletContext?

于 2009-05-07T06:57:53.647 回答