Web services 使用init参数在glassfish中部署Web服务

Web services 使用init参数在glassfish中部署Web服务,web-services,parameters,initialization,glassfish,jax-ws,Web Services,Parameters,Initialization,Glassfish,Jax Ws,我已经使用JAX-WSAPI创建了一个Web服务。此服务使用端点类运行时没有任何问题 main(String args[]) { (...) MyService service=new MyService(); service.setParam1("limit=100"); service.setParam2("hello"); service.setParam3("max-value=10"); Endpoint endpoint = Endpoint.create(service); end

我已经使用JAX-WSAPI创建了一个Web服务。此服务使用端点类运行时没有任何问题

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吗


事先非常感谢

好的,我终于找到了答案:使用javax.xml.ws.WebServiceContext是解决方案。请看这个其他答案