Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions jaxrpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Java EE 7 Samples: JAX-RPC 1.1#

The [JSR 109](https://jcp.org/en/jsr/detail?id=109) specification is the old generation web services API predating JAX-WS

JAX-RPC is **pruned** from Java EE, and **should not be used** anymore. This sample is only provided for historical purposes.

## Samples ##

- jaxrpc-endpoint

## How to run

More information on how to run can be found at: <https://github.com/javaee-samples/javaee7-samples#how-to-run->


31 changes: 31 additions & 0 deletions jaxrpc/jaxrpc-endpoint/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="hello" default="client" basedir=".">

<taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile"/>

<target name="server">
<wscompile
verbose = "true"
define = "true"
mapping = "target/mapping.xml"
keep = "true"
base = "target"
nonClassDir = "target"
features = "rpcliteral"
config = "./src/main/resources/HelloService.xml">
</wscompile>
</target>

<target name="client">
<echo>hello</echo>
<wscompile
client = "true"
verbose = "true"
keep = "true"
base = "target"
features = "rpcliteral"
config = "./src/main/resources/config.xml">
</wscompile>
</target>

</project>
108 changes: 108 additions & 0 deletions jaxrpc/jaxrpc-endpoint/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.javaee7</groupId>
<artifactId>jaxrpc</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>jaxrpc-endpoint</artifactId>
<packaging>war</packaging>
<name>Java EE 7 Sample: jaxrpc - jaxrpc-endpoint</name>

<dependencies>
<dependency>
<groupId>com.sun.xml.rpc</groupId>
<artifactId>jaxrpc-impl</artifactId>
<version>1.1.4_01</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-launcher</artifactId>
<version>1.10.3</version>
</dependency>
</dependencies>


<build>
<finalName>jaxrpc-endpoint</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<java classname="org.apache.tools.ant.launch.Launcher" fork="true" failonerror="true"
dir="." taskname="Ant-JAX-RPC server">
<classpath refid="maven.compile.classpath" />
<arg value="-buildfile" />
<arg file="build.xml" />
<arg value="server" />
<!--
<jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" />
-->
</java>

<copy file="${project.build.directory}/MyHelloService.wsdl" todir="src/main/webapp/WEB-INF/wsdl" verbose="true"/>

<copy file="${project.build.directory}/mapping.xml" todir="src/main/webapp/WEB-INF" verbose="true"/>


<!--
<java classname="org.apache.tools.ant.launch.Launcher" fork="true" failonerror="true"
dir="." timeout="4000000" taskname="Ant-JAX-RPC">
<classpath refid="maven.compile.classpath" />
<arg value="-buildfile" />
<arg file="build.xml" />
<arg value="client" />
<jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" />
</java>


<echo>Copying generated sources</echo>
<copy todir="${project.build.directory}/generated-sources/antrun" verbose="true">
<fileset dir="target/hello"/>
</copy>
-->


</tasks>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/antrun</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.javaee7.jaxrpc.endpoint;

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface HelloService extends Remote {
String sayHello(String s) throws RemoteException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.javaee7.jaxrpc.endpoint;

public class HelloServiceImpl implements HelloService {

public String sayHello(String input) {
return "Hello " + input;
}
}
7 changes: 7 additions & 0 deletions jaxrpc/jaxrpc-endpoint/src/main/resources/HelloService.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<service packageName="org.javaee7.jaxrpc.endpoint" name="MyHelloService"
targetNamespace="urn:sample" typeNamespace="urn:sample">
<interface name="org.javaee7.jaxrpc.endpoint.HelloService" />
</service>
</configuration>
3 changes: 3 additions & 0 deletions jaxrpc/jaxrpc-endpoint/src/main/resources/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<wsdl location="./src/main/resources/HelloWorldService.wsdl" packageName="hello"/>
</configuration>
1 change: 1 addition & 0 deletions jaxrpc/jaxrpc-endpoint/src/main/webapp/WEB-INF/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/mapping.xml
1 change: 1 addition & 0 deletions jaxrpc/jaxrpc-endpoint/src/main/webapp/WEB-INF/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Generated file `mapping.xml` will be saved here.
12 changes: 12 additions & 0 deletions jaxrpc/jaxrpc-endpoint/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<servlet>
<servlet-name>HelloServiceServlet</servlet-name>
<servlet-class>org.javaee7.jaxrpc.endpoint.HelloServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServiceServlet</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>
20 changes: 20 additions & 0 deletions jaxrpc/jaxrpc-endpoint/src/main/webapp/WEB-INF/webservices.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<webservices xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd">
<webservice-description>

<webservice-description-name>MyHelloService</webservice-description-name>

<wsdl-file>WEB-INF/wsdl/MyHelloService.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/mapping.xml</jaxrpc-mapping-file>

<port-component>
<port-component-name>HelloService</port-component-name>
<wsdl-port xmlns:my="urn:sample">my:HelloServicePort</wsdl-port>
<service-endpoint-interface>org.javaee7.jaxrpc.endpoint.HelloService</service-endpoint-interface>
<service-impl-bean>
<servlet-link>HelloServiceServlet</servlet-link>
</service-impl-bean>
</port-component>

</webservice-description>
</webservices>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/MyHelloService.wsdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Generated file `MyHelloService.wsdl` will be saved here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.javaee7.jaxrpc.endpoint;

//import static org.junit.Assert.assertEquals;

import java.net.MalformedURLException;
import java.net.URL;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(Arquillian.class)
public class HelloTest {

@ArquillianResource
private URL url;

@Deployment(testable = false)
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class).
addPackage("org.javaee7.jaxrpc.endpoint");
}

@Before
public void setupClass() throws MalformedURLException {
}

@Test
public void testHello() throws MalformedURLException {
}


}
25 changes: 25 additions & 0 deletions jaxrpc/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.javaee7</groupId>
<artifactId>samples-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>jaxrpc</artifactId>
<packaging>pom</packaging>
<name>Java EE 7 Sample: jaxrpc</name>

<modules>
<module>jaxrpc-endpoint</module>
</modules>

<dependencies>
<dependency>
<groupId>org.javaee7</groupId>
<artifactId>test-utils</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>