Skip to content

Commit 15abd8e

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # apache-cxf/pom.xml
2 parents a2c12b0 + a03168a commit 15abd8e

139 files changed

Lines changed: 4117 additions & 298 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 44 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,47 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5-
<modelVersion>4.0.0</modelVersion>
6-
<artifactId>cxf-introduction</artifactId>
7-
<parent>
8-
<groupId>com.baeldung</groupId>
9-
<artifactId>apache-cxf</artifactId>
10-
<version>0.0.1-SNAPSHOT</version>
11-
</parent>
12-
<properties>
13-
<skipTests>true</skipTests>
14-
<cxf.version>3.1.6</cxf.version>
15-
</properties>
16-
<dependencies>
17-
<dependency>
18-
<groupId>org.apache.cxf</groupId>
19-
<artifactId>cxf-rt-frontend-jaxws</artifactId>
20-
<version>${cxf.version}</version>
21-
</dependency>
22-
<dependency>
23-
<groupId>org.apache.cxf</groupId>
24-
<artifactId>cxf-rt-transports-http-jetty</artifactId>
25-
<version>${cxf.version}</version>
26-
</dependency>
27-
</dependencies>
28-
<profiles>
29-
<profile>
30-
<id>server</id>
31-
<build>
32-
<defaultGoal>test</defaultGoal>
33-
<plugins>
34-
<plugin>
35-
<groupId>org.codehaus.mojo</groupId>
36-
<artifactId>exec-maven-plugin</artifactId>
37-
<executions>
38-
<execution>
39-
<phase>test</phase>
40-
<goals>
41-
<goal>java</goal>
42-
</goals>
43-
<configuration>
44-
<mainClass>com.baeldung.cxf.introduction.Server</mainClass>
45-
</configuration>
46-
</execution>
47-
</executions>
48-
</plugin>
49-
</plugins>
50-
</build>
51-
</profile>
52-
</profiles>
53-
</project>
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<artifactId>cxf-introduction</artifactId>
7+
<parent>
8+
<groupId>com.baeldung</groupId>
9+
<artifactId>apache-cxf</artifactId>
10+
<version>0.0.1-SNAPSHOT</version>
11+
</parent>
12+
<properties>
13+
<cxf.version>3.1.6</cxf.version>
14+
</properties>
15+
<build>
16+
<plugins>
17+
<plugin>
18+
<groupId>org.codehaus.mojo</groupId>
19+
<artifactId>exec-maven-plugin</artifactId>
20+
<configuration>
21+
<mainClass>com.baeldung.cxf.introduction.Server</mainClass>
22+
</configuration>
23+
</plugin>
24+
<plugin>
25+
<artifactId>maven-surefire-plugin</artifactId>
26+
<version>2.19.1</version>
27+
<configuration>
28+
<excludes>
29+
<exclude>**/StudentTest.java</exclude>
30+
</excludes>
31+
</configuration>
32+
</plugin>
33+
</plugins>
34+
</build>
35+
<dependencies>
36+
<dependency>
37+
<groupId>org.apache.cxf</groupId>
38+
<artifactId>cxf-rt-frontend-jaxws</artifactId>
39+
<version>${cxf.version}</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.apache.cxf</groupId>
43+
<artifactId>cxf-rt-transports-http-jetty</artifactId>
44+
<version>${cxf.version}</version>
45+
</dependency>
46+
</dependencies>
47+
</project>

‎apache-cxf/cxf-introduction/src/main/java/com/baeldung/cxf/introduction/Server.java‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33
import javax.xml.ws.Endpoint;
44

55
public class Server {
6-
private Server() {
6+
public static void main(String args[]) throws InterruptedException {
77
BaeldungImpl implementor = new BaeldungImpl();
88
String address = "http://localhost:8080/baeldung";
99
Endpoint.publish(address, implementor);
10-
}
11-
12-
public static void main(String args[]) throws InterruptedException {
13-
new Server();
14-
System.out.println("Server ready");
10+
System.out.println("Server ready...");
1511
Thread.sleep(60 * 1000);
1612
System.out.println("Server exiting");
1713
System.exit(0);

‎apache-cxf/cxf-introduction/src/test/java/com/baeldung/cxf/introduction/StudentTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class StudentTest {
2121

2222
private Service service;
2323
private Baeldung baeldungProxy;
24-
private Baeldung baeldungImpl;
24+
private BaeldungImpl baeldungImpl;
2525

2626
{
2727
service = Service.create(SERVICE_NAME);

‎apache-cxf/cxf-spring/pom.xml‎

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>cxf-spring</artifactId>
5+
<packaging>war</packaging>
6+
<parent>
7+
<groupId>com.baeldung</groupId>
8+
<artifactId>apache-cxf</artifactId>
9+
<version>0.0.1-SNAPSHOT</version>
10+
</parent>
11+
<properties>
12+
<cxf.version>3.1.6</cxf.version>
13+
<spring.version>4.3.1.RELEASE</spring.version>
14+
<surefire.version>2.19.1</surefire.version>
15+
</properties>
16+
<build>
17+
<plugins>
18+
<plugin>
19+
<artifactId>maven-war-plugin</artifactId>
20+
<version>2.6</version>
21+
<configuration>
22+
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
23+
</configuration>
24+
</plugin>
25+
<plugin>
26+
<artifactId>maven-surefire-plugin</artifactId>
27+
<version>${surefire.version}</version>
28+
<configuration>
29+
<excludes>
30+
<exclude>StudentTest.java</exclude>
31+
</excludes>
32+
</configuration>
33+
</plugin>
34+
</plugins>
35+
</build>
36+
<profiles>
37+
<profile>
38+
<id>integration</id>
39+
<build>
40+
<plugins>
41+
<plugin>
42+
<groupId>org.codehaus.cargo</groupId>
43+
<artifactId>cargo-maven2-plugin</artifactId>
44+
<version>1.5.0</version>
45+
<configuration>
46+
<container>
47+
<containerId>jetty9x</containerId>
48+
<type>embedded</type>
49+
</container>
50+
<configuration>
51+
<properties>
52+
<cargo.hostname>localhost</cargo.hostname>
53+
<cargo.servlet.port>8080</cargo.servlet.port>
54+
</properties>
55+
</configuration>
56+
</configuration>
57+
<executions>
58+
<execution>
59+
<id>start-server</id>
60+
<phase>pre-integration-test</phase>
61+
<goals>
62+
<goal>start</goal>
63+
</goals>
64+
</execution>
65+
<execution>
66+
<id>stop-server</id>
67+
<phase>post-integration-test</phase>
68+
<goals>
69+
<goal>stop</goal>
70+
</goals>
71+
</execution>
72+
</executions>
73+
</plugin>
74+
<plugin>
75+
<artifactId>maven-surefire-plugin</artifactId>
76+
<version>${surefire.version}</version>
77+
<executions>
78+
<execution>
79+
<phase>integration-test</phase>
80+
<goals>
81+
<goal>test</goal>
82+
</goals>
83+
<configuration>
84+
<excludes>
85+
<exclude>none</exclude>
86+
</excludes>
87+
</configuration>
88+
</execution>
89+
</executions>
90+
</plugin>
91+
</plugins>
92+
</build>
93+
</profile>
94+
</profiles>
95+
<dependencies>
96+
<dependency>
97+
<groupId>org.apache.cxf</groupId>
98+
<artifactId>cxf-rt-frontend-jaxws</artifactId>
99+
<version>${cxf.version}</version>
100+
</dependency>
101+
<dependency>
102+
<groupId>org.apache.cxf</groupId>
103+
<artifactId>cxf-rt-transports-http-jetty</artifactId>
104+
<version>${cxf.version}</version>
105+
</dependency>
106+
<dependency>
107+
<groupId>org.springframework</groupId>
108+
<artifactId>spring-context</artifactId>
109+
<version>${spring.version}</version>
110+
</dependency>
111+
<dependency>
112+
<groupId>org.springframework</groupId>
113+
<artifactId>spring-web</artifactId>
114+
<version>${spring.version}</version>
115+
</dependency>
116+
</dependencies>
117+
</project>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.baeldung.cxf.spring;
2+
3+
import javax.jws.WebService;
4+
5+
@WebService
6+
public interface Baeldung {
7+
String hello(String name);
8+
String register(Student student);
9+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.baeldung.cxf.spring;
2+
3+
import javax.jws.WebService;
4+
5+
@WebService(endpointInterface = "com.baeldung.cxf.spring.Baeldung")
6+
public class BaeldungImpl implements Baeldung {
7+
private int counter;
8+
9+
public String hello(String name) {
10+
return "Hello " + name + "!";
11+
}
12+
13+
public String register(Student student) {
14+
counter++;
15+
return student.getName() + " is registered student number " + counter;
16+
}
17+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.baeldung.cxf.spring;
2+
3+
public class Student {
4+
private String name;
5+
6+
Student() {
7+
}
8+
9+
public Student(String name) {
10+
this.name = name;
11+
}
12+
13+
public String getName() {
14+
return name;
15+
}
16+
17+
public void setName(String name) {
18+
this.name = name;
19+
}
20+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
4+
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
5+
<bean id="client" factory-bean="clientFactory" factory-method="create" />
6+
<bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
7+
<property name="serviceClass" value="com.baeldung.cxf.spring.Baeldung" />
8+
<property name="address" value="http://localhost:8080/services/baeldung" />
9+
</bean>
10+
</beans>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
4+
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
5+
<jaxws:endpoint id="baeldung"
6+
implementor="com.baeldung.cxf.spring.BaeldungImpl" address="http://localhost:8080/services/baeldung" />
7+
</beans>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
version="3.0"
4+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
5+
<servlet>
6+
<servlet-name>cxf</servlet-name>
7+
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
8+
<load-on-startup>1</load-on-startup>
9+
</servlet>
10+
<servlet-mapping>
11+
<servlet-name>cxf</servlet-name>
12+
<url-pattern>/services/*</url-pattern>
13+
</servlet-mapping>
14+
</web-app>

0 commit comments

Comments
 (0)