开发者

Jetty and Jibx-ws web services

I've read the SOAP Service documentation and example in te Jibx-ws website but how do I con开发者_Go百科figure my Jetty Server object to serve it?

Thanks!


JiBX-WS is just a plain old servlet. You install and configure it just like any other servlet.

The easy answer, is just drop your war file in jetty's webapps directory.

If you need a simple example to get started, try this on your command line. (You will need subversion and 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

Now that you have a working sample, getting your web service up and running will be a snap!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜