0

我已经阅读了 te Jibx-ws 网站中的 SOAP 服务文档和示例,但是如何配置我的 Jetty Server 对象来提供服务?

谢谢!

4

1 回答 1

0

JiBX-WS 只是一个普通的旧 servlet。您可以像任何其他 servlet 一样安装和配置它。

简单的答案就是把你的war文件放到jetty的webapps目录中。

如果您需要一个简单的示例来开始,请在命令行上尝试此操作。(你需要颠覆和 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 服务将是一件轻而易举的事!

于 2011-09-20T19:20:46.157 回答