Question

I've created a WebService using the JAX-WS API. This service runs without any problem using an 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'd like to deploy this service in glassfish. However, as I wrote in my example, I'd like to initialize my service with a some parameters. How can I achieve this ? should I use another API ?

Many thanks in advance

Was it helpful?

Solution

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 within a JAX-WS web service?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top