Skip to content

Commit 32f8b54

Browse files
authored
Initial JAX-RPC sample, for historical purposes only (#434)
Initial JAX-RPC sample, for historical purposes only
1 parent 66eff5f commit 32f8b54

15 files changed

Lines changed: 279 additions & 0 deletions

File tree

jaxrpc/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Java EE 7 Samples: JAX-RPC 1.1#
2+
3+
The [JSR 109](https://jcp.org/en/jsr/detail?id=109) specification is the old generation web services API predating JAX-WS
4+
5+
JAX-RPC is **pruned** from Java EE, and **should not be used** anymore. This sample is only provided for historical purposes.
6+
7+
## Samples ##
8+
9+
- jaxrpc-endpoint
10+
11+
## How to run
12+
13+
More information on how to run can be found at: <https://github.com/javaee-samples/javaee7-samples#how-to-run->
14+
15+

jaxrpc/jaxrpc-endpoint/build.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project name="hello" default="client" basedir=".">
3+
4+
<taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile"/>
5+
6+
<target name="server">
7+
<wscompile
8+
verbose = "true"
9+
define = "true"
10+
mapping = "target/mapping.xml"
11+
keep = "true"
12+
base = "target"
13+
nonClassDir = "target"
14+
features = "rpcliteral"
15+
config = "./src/main/resources/HelloService.xml">
16+
</wscompile>
17+
</target>
18+
19+
<target name="client">
20+
<echo>hello</echo>
21+
<wscompile
22+
client = "true"
23+
verbose = "true"
24+
keep = "true"
25+
base = "target"
26+
features = "rpcliteral"
27+
config = "./src/main/resources/config.xml">
28+
</wscompile>
29+
</target>
30+
31+
</project>

jaxrpc/jaxrpc-endpoint/pom.xml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>org.javaee7</groupId>
8+
<artifactId>jaxrpc</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>jaxrpc-endpoint</artifactId>
13+
<packaging>war</packaging>
14+
<name>Java EE 7 Sample: jaxrpc - jaxrpc-endpoint</name>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>com.sun.xml.rpc</groupId>
19+
<artifactId>jaxrpc-impl</artifactId>
20+
<version>1.1.4_01</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>org.apache.ant</groupId>
24+
<artifactId>ant-launcher</artifactId>
25+
<version>1.10.3</version>
26+
</dependency>
27+
</dependencies>
28+
29+
30+
<build>
31+
<finalName>jaxrpc-endpoint</finalName>
32+
<plugins>
33+
<plugin>
34+
<groupId>org.apache.maven.plugins</groupId>
35+
<artifactId>maven-antrun-plugin</artifactId>
36+
<version>1.1</version>
37+
<executions>
38+
<execution>
39+
<phase>process-classes</phase>
40+
<goals>
41+
<goal>run</goal>
42+
</goals>
43+
<configuration>
44+
<tasks>
45+
<java classname="org.apache.tools.ant.launch.Launcher" fork="true" failonerror="true"
46+
dir="." taskname="Ant-JAX-RPC server">
47+
<classpath refid="maven.compile.classpath" />
48+
<arg value="-buildfile" />
49+
<arg file="build.xml" />
50+
<arg value="server" />
51+
<!--
52+
<jvmarg value="-Xdebug" />
53+
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" />
54+
-->
55+
</java>
56+
57+
<copy file="${project.build.directory}/MyHelloService.wsdl" todir="src/main/webapp/WEB-INF/wsdl" verbose="true"/>
58+
59+
<copy file="${project.build.directory}/mapping.xml" todir="src/main/webapp/WEB-INF" verbose="true"/>
60+
61+
62+
<!--
63+
<java classname="org.apache.tools.ant.launch.Launcher" fork="true" failonerror="true"
64+
dir="." timeout="4000000" taskname="Ant-JAX-RPC">
65+
<classpath refid="maven.compile.classpath" />
66+
<arg value="-buildfile" />
67+
<arg file="build.xml" />
68+
<arg value="client" />
69+
<jvmarg value="-Xdebug" />
70+
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" />
71+
</java>
72+
73+
74+
<echo>Copying generated sources</echo>
75+
<copy todir="${project.build.directory}/generated-sources/antrun" verbose="true">
76+
<fileset dir="target/hello"/>
77+
</copy>
78+
-->
79+
80+
81+
</tasks>
82+
</configuration>
83+
</execution>
84+
</executions>
85+
</plugin>
86+
87+
<plugin>
88+
<groupId>org.codehaus.mojo</groupId>
89+
<artifactId>build-helper-maven-plugin</artifactId>
90+
<version>3.0.0</version>
91+
<executions>
92+
<execution>
93+
<id>generate-sources</id>
94+
<phase>generate-sources</phase>
95+
<goals>
96+
<goal>add-source</goal>
97+
</goals>
98+
<configuration>
99+
<sources>
100+
<source>${project.build.directory}/generated-sources/antrun</source>
101+
</sources>
102+
</configuration>
103+
</execution>
104+
</executions>
105+
</plugin>
106+
</plugins>
107+
</build>
108+
</project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.javaee7.jaxrpc.endpoint;
2+
3+
import java.rmi.Remote;
4+
import java.rmi.RemoteException;
5+
6+
public interface HelloService extends Remote {
7+
String sayHello(String s) throws RemoteException;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.javaee7.jaxrpc.endpoint;
2+
3+
public class HelloServiceImpl implements HelloService {
4+
5+
public String sayHello(String input) {
6+
return "Hello " + input;
7+
}
8+
}
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+
<configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
3+
<service packageName="org.javaee7.jaxrpc.endpoint" name="MyHelloService"
4+
targetNamespace="urn:sample" typeNamespace="urn:sample">
5+
<interface name="org.javaee7.jaxrpc.endpoint.HelloService" />
6+
</service>
7+
</configuration>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
2+
<wsdl location="./src/main/resources/HelloWorldService.wsdl" packageName="hello"/>
3+
</configuration>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/mapping.xml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Generated file `mapping.xml` will be saved here.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
2+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
3+
4+
<servlet>
5+
<servlet-name>HelloServiceServlet</servlet-name>
6+
<servlet-class>org.javaee7.jaxrpc.endpoint.HelloServiceImpl</servlet-class>
7+
</servlet>
8+
<servlet-mapping>
9+
<servlet-name>HelloServiceServlet</servlet-name>
10+
<url-pattern>/hello</url-pattern>
11+
</servlet-mapping>
12+
</web-app>

0 commit comments

Comments
 (0)