User Tools

Site Tools


web-integration:java-example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
web-integration:java-example [2019/08/15 06:17]
740803864 [Web Integration]
web-integration:java-example [2019/08/15 06:49]
740803864 [Web Application Configuration File]
Line 159: Line 159:
  
 ===== Web Integration ===== ===== Web Integration =====
 +
 +==== Start Page ====
 +
 Servlets described earlier are used in ''index.jsp'' page: Servlets described earlier are used in ''index.jsp'' page:
  
Line 236: Line 239:
 </code> </code>
  
 +==== Result Page ====
 +
 +After successful authentication, ''UDI'' value is printed at ''result.jsp'' page:
 +
 +<code javascript>
 +<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
 +
 +<head>
 +</head>
 +<body>
 +
 + <h1>SECURE PAGE</h1>
 + UDI: ${result.userDatabaseIndex}
 + <br></br>
 + <a href="index.jsp">Try again</a>
 +
 +</body>
 +</html>
 +</code>
 ===== Web Application Configuration File ===== ===== Web Application Configuration File =====
-This file is required by Servlet API. This file provides to application ''wsUrl'' configuration value:+This file is required by Servlet API. File provides ''wsUrl'' configuration value:
  
 <code xml> <code xml>
Line 263: Line 285:
 ===== Maven Configuration File ===== ===== Maven Configuration File =====
  
 +Maven configuration file contents definition of plugin to generate WS classes and instruction to filter ''${ws.url}'' value:
 +
 +<code xml>
 +<?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/maven-v4_0_0.xsd">
 +    <modelVersion>4.0.0</modelVersion>
 +    <groupId>com.aducid</groupId>
 +    <version>1.DEV-SNAPSHOT</version>
 +    <packaging>war</packaging>
 +    <artifactId>example_ws</artifactId>
 +    <name>demo: example ws</name>
 +    <build>
 +        <finalName>example-ws</finalName>
 +        <plugins>
 +            <plugin>
 +                <groupId>org.apache.maven.plugins</groupId>
 +                <artifactId>maven-compiler-plugin</artifactId>
 +                <version>3.8.1</version>
 +                <configuration>
 +                    <source>1.8</source>
 +                    <target>1.8</target>
 +                    <encoding>UTF-8</encoding>
 +                    <debug>true</debug>
 +                    <showWarnings>true</showWarnings>
 +                </configuration>
 +            </plugin>
 +            <plugin>
 +                <groupId>org.jvnet.jax-ws-commons</groupId>
 +                <artifactId>jaxws-maven-plugin</artifactId>
 +                <version>2.3</version>
 +                <executions>
 +                    <execution>
 +                        <id>client</id>
 +                        <configuration>
 +                            <wsdlUrls>
 +                                <wsdlUrl>${ws.url}/aducid-client-api-ws/wsa?wsdl</wsdlUrl>
 +                            </wsdlUrls>
 +                            <vmArgs>
 +                                <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
 +                            </vmArgs>
 +                            <encoding>UTF-8</encoding>
 +                        </configuration>
 +                        <goals>
 +                            <goal>wsimport</goal>
 +                        </goals>
 +                    </execution>
 +                </executions>
 +            </plugin>
 +            <plugin>
 +                <groupId>org.apache.maven.plugins</groupId>
 +                <artifactId>maven-war-plugin</artifactId>
 +                <version>3.2.2</version>
 +                <configuration>
 +                    <webResources>
 +                        <resource>
 +                            <filtering>true</filtering>
 +                            <directory>src/main/webapp</directory>
 +                            <includes>
 +                                <include>WEB-INF/web.xml</include>
 +                            </includes>
 +                        </resource>
 +                        <resource>
 +                            <directory>${project.build.sourceDirectory}</directory>
 +                            <targetPath>sources</targetPath>
 +                        </resource>
 +                    </webResources>
 +                </configuration>
 +            </plugin>
 +        </plugins>
 +    </build>
 +    <dependencies>
 +        <dependency>
 +            <groupId>javax.servlet</groupId>
 +            <artifactId>javax.servlet-api</artifactId>
 +            <version>3.0.1</version>
 +            <scope>provided</scope>
 +        </dependency>
 +    </dependencies>
 +</project>
 +</code>
 ===== Building Application ===== ===== Building Application =====
 +
 +There is prepared batch file ''build.bat'' to build application. It is neccessary to define right ''ws.url'' value as an address to AIM server:
 +
 +<code>
 +set MAVEN_OPTS="-Xmx512m"
 +mvn -Dws.url=https://myaim.aducid.com -Dfile.encoding=UTF-8 clean install
 +</code>
  
web-integration/java-example.txt ยท Last modified: 2020/02/29 10:52 by mpospisek