0

Apache CXF クライアント API を使用して Web サービスを利用する方法。eclispe を使用してクライアント コードを生成しましたが、その生成されたコードを Web アプリケーションで使用する方法を指定するドキュメントが見つかりませんでした。

CXF の設定方法 Tomcat を使用して Java Web アプリケーションを実行しています。生成されたコードの使用方法 web.xml に何か追加する必要がありますか?

apache CXF Web サイトから CXF バイナリをダウンロードしましたが、必要なライブラリがわかりません。私は、すべての瓶を追加することになるのではないかと心配しています。

アプリケーションにTomcat 7、Java 1.6、およびplane jsp/Servletを使用しています

私はWebサービスが初めてです。前もって感謝します

4

1 に答える 1

0

役立つサンプルコードを 1 つ。

URL wsdlurl=SOAPWebServiceTransport.class.getClassLoader().
                getResource("my.wsdl");
// MyService will be one of the service class that you have generated (with different name ofcourse)and which must be extending Service class
//getOnlineServicePort will be a method (with different name ofcourse) in your service class which will give you the interface referrer using which you'll call the webservice method 
OnlinePort service= new MyService(wsdlurl).getOnlineServicePort();
Client proxy = ClientProxy.getClient(service);
//configure security user name password as required
//Add interceptors if needed
//Now you can directly call the webservice methods using the service object
service.method(parameter)

ここにあるいくつかの例を参照することもできます

于 2015-06-27T08:20:20.900 に答える