0

JAX-WS API を使用して WebService を作成しました。このサービスは、エンドポイント クラスを使用して問題なく実行されます。

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

今、このサービスをグラスフィッシュにデプロイしたいと思います。ただし、私の例で書いたように、いくつかのパラメーターを使用してサービスを初期化したいと考えています。どうすればこれを達成できますか? 別の API を使用する必要がありますか?

よろしくお願いします

4

1 に答える 1

0

OK、私は最終的に答えを見つけました: using javax.xml.ws.WebServiceContextis the solution .see this other answer How can I access the ServletContext from within a JAX-WS Web service?

于 2009-05-07T06:57:53.647 に答える