File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" >
3+ <parent >
4+ <artifactId >java_component</artifactId >
5+ <groupId >com.critc</groupId >
6+ <version >1.0-SNAPSHOT</version >
7+ </parent >
8+ <modelVersion >4.0.0</modelVersion >
9+ <artifactId >chapter9_1_xfire_server</artifactId >
10+ <packaging >war</packaging >
11+ <name >chapter9_1_xfire_server Maven Webapp</name >
12+ <url >http://maven.apache.org</url >
13+ <dependencies >
14+ <dependency >
15+ <groupId >org.codehaus.xfire</groupId >
16+ <artifactId >xfire-all</artifactId >
17+ <version >1.2.6</version >
18+ </dependency >
19+ <dependency >
20+ <groupId >jstl</groupId >
21+ <artifactId >jstl</artifactId >
22+ <version >1.2</version >
23+ </dependency >
24+ <dependency >
25+ <groupId >javax.servlet</groupId >
26+ <artifactId >javax.servlet-api</artifactId >
27+ <version >3.1.0</version >
28+ </dependency >
29+ </dependencies >
30+ <build >
31+ <finalName >chapter9_1_xfire_server</finalName >
32+ </build >
33+ </project >
Original file line number Diff line number Diff line change 1+ package com .critc .xfire ;
2+
3+ /**
4+ * Author 孔垂云
5+ * Date 2017/5/25.
6+ */
7+ public interface FirstService {
8+ public String sayHello (String name );
9+ }
Original file line number Diff line number Diff line change 1+ package com .critc .xfire ;
2+
3+ /**
4+ * Author 孔垂云
5+ * Date 2017/5/25.
6+ */
7+ public class FirstServiceImpl implements FirstService {
8+
9+ public String sayHello (String name ) {
10+ return "hello:" + name ;
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ package com .critc .xfire ;
2+
3+ import org .codehaus .xfire .client .Client ;
4+
5+ import java .net .URL ;
6+
7+ /**
8+ * Author 孔垂云
9+ * Date 2017/5/25.
10+ */
11+ public class TestXfire {
12+
13+ public static void main (String [] args ) {
14+ try {
15+ Client client = new Client (new URL ("http://localhost:8080/services/FirstService?wsdl" ));
16+ Object [] results = client .invoke ("sayHello" , new Object [] { "张三" });
17+ System .out .println ((String ) results [0 ]);
18+ } catch (Exception e ) {
19+ e .printStackTrace ();
20+ }
21+ }
22+ }
Original file line number Diff line number Diff line change 1+ <beans >
2+ <service xmlns =" http://xfire.codehaus.org/config/1.0" >
3+ <name >FirstService</name >
4+ <namespace >http://smallnest.googlepages.com/FirstService</namespace >
5+ <serviceClass >com.critc.xfire.FirstService</serviceClass >
6+ <implementationClass >com.critc.xfire.FirstServiceImpl</implementationClass >
7+ </service >
8+ </beans >
Original file line number Diff line number Diff line change 2424 <module >chapter11_1_multithread</module >
2525 <module >chapter11_2_multithread_guava</module >
2626 <module >chapter6_verifycode</module >
27+ <module >chapter9_1_xfire_server</module >
2728 </modules >
2829 <packaging >pom</packaging >
2930
You can’t perform that action at this time.
0 commit comments