2011-07-31 12 views
0

私はJibx-wsのWebサイトのSOAPサービスのドキュメントと例を読んだことがありますが、Jetty Serverオブジェクトを提供するように設定するにはどうすればよいですか?JettyとJibx-wsのWebサービス

ありがとうございます!

答えて

0

JiBX-WSは単純な古いサーブレットです。他のサーブレットと同じようにインストールして設定します。

簡単な答えは、あなたのwarファイルをjettyのwebappsディレクトリにドロップすることです。

簡単な例が必要な場合は、コマンドラインでこれを試してみてください。 (SubversionとMavenが必要です)

svn checkout https://jibx.svn.sourceforge.net/svnroot/jibx/trunk/web-services/jibxws/examples/maven/hello-world 
(this is a simple example that creates a JiBX-WS war and has client code to test it) 
cd hello-world 
(now you will need to edit all 6 pom.xml files so that they are referencing release versions, other then SNAPSHOTS., ie., 1.2.4-SNAPSHOT -> 1.2.3) 
mvn clean 
mvn install 
(make sure jetty is running... bin/jetty start) 
cp war/target/org.jibx.ws.test.helloworld.war-0.9.1.war /jetty/webapp/ 
(move the war file in the war/target directory your your jetty/webapps directory - the web service will be served at localhost:8080/org.jibx.ws.test.helloworld.war-0.9.1) 
cd client 
(edit the web service address in the client/src/main/java/org/jibx/ws/test/helloworld/client/HelloClient.java file to read:   String target = "http://localhost:8080/org.jibx.ws.test.helloworld.war-0.9.1"; 
mvn clean install 
mvn exec:java 
(you should see a message that contains this:) 
[INFO] --- exec-maven-plugin:1.2:java (default-cli) @ org.jibx.ws.test.helloworld.client --- 
Hello World! 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 

実際のサンプルがあるので、Webサービスを起動して実行するのは簡単です!

関連する問題