Deploying WebService to Glassfish with init parameters

I created a WebService using the JAX-WS API. This service works without any problem using the Endpoint class.

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");
(...)
}

      

Now I would like to deploy this service in a glass shawl. However, as I wrote in my example, I would like to initialize my service with some parameters. How can I achieve this? use a different API?

Thank you very much in advance

0


source to share


1 answer


OK, I finally found the answer: using javax.xml.ws.WebServiceContext

was the solution .see this other answer How can I access the ServletContext from a JAX-WS web service?



0


source







All Articles