Skip to content

Commit 2e310ee

Browse files
committed
Add extend-access-ws web service sample for OIG/WebLogic
1 parent 732e84a commit 2e310ee

File tree

9 files changed

+626
-0
lines changed

9 files changed

+626
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2023 Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15+
one is included with the Software (each a "Larger Work" to which the Software
16+
is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Extend Access WebService
2+
3+
This asset contains the code and deployment items for a RESTful service which will extend user access rights.
4+
5+
The scheduled task needs to be used in conjunction with the Access Extension Notification scheduled task, which will generate the data and send the required actionable notification links. The endpoints exposed by this WebService will act as backend providers for those links.
6+
7+
Developed on and compatible with OIG 11g R2 PS3 and above.
8+
9+
## When to use this asset?
10+
11+
When there's a need to provide or demonstrate the functionality described above or something similar, which can be adapted from the provided code.
12+
13+
## How to use this asset?
14+
15+
### Pre-requisites and dependencies
16+
17+
The WebService is build using the JAX-RS specification and API.
18+
19+
As such, the following jar files are required as dependencies and need to be used during the build process:
20+
- axis.jar
21+
- commons-discovery-0.2.jar
22+
- commons-logging.jar
23+
- eclipselink.jar
24+
- jackson-core-asl-1.9.2.jar
25+
- jackson-jaxrs-1.9.2.jar
26+
- jackson-mapper-asl-1.9.2.jar
27+
- jackson-xc-1.9.2.jar
28+
- jaxrpc.jar
29+
- jersey-client-1.19.1.jar
30+
- jersey-core-1.19.1.jar
31+
- jersey-json-1.19.1.jar
32+
- jersey-server-1.19.1.jar
33+
- jersey-servlet-1.19.1.jar
34+
- jettison-1.1.jar
35+
- jsr311-api-1.1.1.jar
36+
- saaj.jar
37+
- spring.jar
38+
- wsdl4j.jar
39+
40+
To connect to an OIM node, the service will also use a full OIM client, and will also need the following jar file:
41+
- oimclient.jar
42+
43+
Note that this is a full OIM client. On more details about exporting a full OIM client jar file, please consult the developer's guide linked below.
44+
45+
### Building and deployment
46+
47+
A complete WebContent deployment configuration is provided as a sample, please use it and extend it as needed.
48+
49+
Note that the use of a build system such as Ant or Maven is encouraged, however manually building the war file is also possible, by running `jar -cvf extend_access.war .` in the WebContent folder.
50+
51+
Here's a short build and deployment checklist:
52+
53+
1. Set the proper configuration parameters in the `extendaccessws.properties` file and copy it under `$DOMAIN_HOME/config` on the target WebLogic domain
54+
2. Copy the above mentioned dependency jars under `WebContent\WEB-INF\lib` and build/export the WebService war file.
55+
3. Deploy the war file on a WebLogic node. Note that the deployment node needs to include a deployment of the jdbc/operationsDB datasource, also known as oimOperationsDB. This datasource is typically deployed only on the OIM and SOA nodes of a WebLogic cluster.
56+
4. Activate the new deployment to start servicing requests, if this isn't done automatically.
57+
58+
Please see the useful link below for detailed build and deployment steps.
59+
60+
## Useful Links
61+
62+
[The Java API for RESTful Web Services (JAX-RS)](https://www.oracle.com/technical-resources/articles/java/jax-rs.html)
63+
[JSR 311: JAX-RS: The JavaTM API for RESTful Web Services](https://jcp.org/en/jsr/detail?id=311)
64+
[Oracle Identity Governance developer's guide - Developing scheduled tasks](https://docs.oracle.com/en/middleware/idm/identity-governance/12.2.1.4/omdev/developing-scheduled-tasks.html#GUID-F62EF833-1E70-41FC-9DCC-C1EAB407D151)
65+
66+
# License
67+
68+
Copyright (c) 2023 Oracle and/or its affiliates.
69+
70+
Licensed under the Universal Permissive License (UPL), Version 1.0.
71+
72+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Class-Path:
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?><!-- Use this file to deploy some handlers/chains and services --><!-- Two ways to do this: --><!-- java org.apache.axis.client.AdminClient deploy.wsdd --><!-- after the axis server is running --><!-- or --><!-- java org.apache.axis.utils.Admin client|server deploy.wsdd --><!-- from the same directory that the Axis engine runs --><deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
2+
3+
<!-- Services from ExtendAccessWSv1Service WSDL service -->
4+
5+
<service name="ExtendAccessWSv1" provider="java:RPC" style="wrapped" use="literal">
6+
<parameter name="wsdlTargetNamespace" value="http://samplews.oracle.com"/>
7+
<parameter name="wsdlServiceElement" value="ExtendAccessWSv1Service"/>
8+
<parameter name="schemaQualified" value="http://samplews.oracle.com"/>
9+
<parameter name="wsdlServicePort" value="ExtendAccessWSv1"/>
10+
<parameter name="className" value="com.oracle.samplews.ExtendAccessWSv1"/>
11+
<parameter name="wsdlPortType" value="ExtendAccessWSv1"/>
12+
<parameter name="typeMappingVersion" value="1.2"/>
13+
<operation xmlns:operNS="http://samplews.oracle.com" xmlns:retNS="http://samplews.oracle.com" xmlns:rtns="http://www.w3.org/2001/XMLSchema" name="extendAccess" qname="operNS:extendAccess" returnQName="retNS:extendAccessReturn" returnType="rtns:string" soapAction="">
14+
<parameter xmlns:pns="http://samplews.oracle.com" xmlns:tns="http://www.w3.org/2001/XMLSchema" qname="pns:userId" type="tns:string"/>
15+
<parameter xmlns:pns="http://samplews.oracle.com" xmlns:tns="http://www.w3.org/2001/XMLSchema" qname="pns:eaUUID" type="tns:string"/>
16+
</operation>
17+
<parameter name="allowedMethods" value="extendAccess"/>
18+
19+
</service>
20+
</deployment>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- Use this file to undeploy some handlers/chains and services -->
2+
<!-- Two ways to do this: -->
3+
<!-- java org.apache.axis.client.AdminClient undeploy.wsdd -->
4+
<!-- after the axis server is running -->
5+
<!-- or -->
6+
<!-- java org.apache.axis.utils.Admin client|server undeploy.wsdd -->
7+
<!-- from the same directory that the Axis engine runs -->
8+
9+
<undeployment
10+
xmlns="http://xml.apache.org/axis/wsdd/">
11+
12+
<!-- Services from ExtendAccessWSv1Service WSDL service -->
13+
14+
<service name="ExtendAccessWSv1"/>
15+
</undeployment>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
3+
<display-name>extend_access</display-name>
4+
<servlet>
5+
<description>JAX-RS Tools Generated - Do not modify</description>
6+
<servlet-name>extend_access</servlet-name>
7+
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
8+
<init-param>
9+
<param-name>com.sun.jersey.config.property.packages</param-name>
10+
<param-value>com.oracle.samplews</param-value>
11+
</init-param>
12+
<init-param>
13+
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
14+
<param-value>true</param-value>
15+
</init-param>
16+
<load-on-startup>1</load-on-startup>
17+
</servlet>
18+
<servlet-mapping>
19+
<servlet-name>extend_access</servlet-name>
20+
<url-pattern>/rest/*</url-pattern>
21+
</servlet-mapping>
22+
<servlet>
23+
<display-name>Apache-Axis Servlet</display-name>
24+
<servlet-name>AxisServlet</servlet-name>
25+
<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
26+
</servlet>
27+
<servlet-mapping>
28+
<servlet-name>AxisServlet</servlet-name>
29+
<url-pattern>/servlet/AxisServlet</url-pattern>
30+
</servlet-mapping>
31+
<servlet-mapping>
32+
<servlet-name>AxisServlet</servlet-name>
33+
<url-pattern>*.jws</url-pattern>
34+
</servlet-mapping>
35+
<servlet-mapping>
36+
<servlet-name>AxisServlet</servlet-name>
37+
<url-pattern>/services/*</url-pattern>
38+
</servlet-mapping>
39+
<servlet>
40+
<display-name>Axis Admin Servlet</display-name>
41+
<servlet-name>AdminServlet</servlet-name>
42+
<servlet-class>org.apache.axis.transport.http.AdminServlet</servlet-class>
43+
<load-on-startup>100</load-on-startup>
44+
</servlet>
45+
<servlet-mapping>
46+
<servlet-name>AdminServlet</servlet-name>
47+
<url-pattern>/servlet/AdminServlet</url-pattern>
48+
</servlet-mapping>
49+
</web-app>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<wsdl:definitions targetNamespace="http://samplews.oracle.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://samplews.oracle.com" xmlns:intf="http://samplews.oracle.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<!--WSDL created by Apache Axis version: 1.4
4+
Built on Apr 22, 2006 (06:55:48 PDT)-->
5+
<wsdl:types>
6+
<schema elementFormDefault="qualified" targetNamespace="http://samplews.oracle.com" xmlns="http://www.w3.org/2001/XMLSchema">
7+
<element name="extendAccess">
8+
<complexType>
9+
<sequence>
10+
<element name="userId" type="xsd:string"/>
11+
<element name="eaUUID" type="xsd:string"/>
12+
</sequence>
13+
</complexType>
14+
</element>
15+
<element name="extendAccessResponse">
16+
<complexType>
17+
<sequence>
18+
<element name="extendAccessReturn" type="xsd:string"/>
19+
</sequence>
20+
</complexType>
21+
</element>
22+
</schema>
23+
</wsdl:types>
24+
<wsdl:message name="extendAccessRequest">
25+
<wsdl:part element="impl:extendAccess" name="parameters">
26+
</wsdl:part>
27+
</wsdl:message>
28+
<wsdl:message name="extendAccessResponse">
29+
<wsdl:part element="impl:extendAccessResponse" name="parameters">
30+
</wsdl:part>
31+
</wsdl:message>
32+
<wsdl:portType name="ExtendAccessWSv1">
33+
<wsdl:operation name="extendAccess">
34+
<wsdl:input message="impl:extendAccessRequest" name="extendAccessRequest">
35+
</wsdl:input>
36+
<wsdl:output message="impl:extendAccessResponse" name="extendAccessResponse">
37+
</wsdl:output>
38+
</wsdl:operation>
39+
</wsdl:portType>
40+
<wsdl:binding name="ExtendAccessWSv1SoapBinding" type="impl:ExtendAccessWSv1">
41+
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
42+
<wsdl:operation name="extendAccess">
43+
<wsdlsoap:operation soapAction=""/>
44+
<wsdl:input name="extendAccessRequest">
45+
<wsdlsoap:body use="literal"/>
46+
</wsdl:input>
47+
<wsdl:output name="extendAccessResponse">
48+
<wsdlsoap:body use="literal"/>
49+
</wsdl:output>
50+
</wsdl:operation>
51+
</wsdl:binding>
52+
<wsdl:service name="ExtendAccessWSv1Service">
53+
<wsdl:port binding="impl:ExtendAccessWSv1SoapBinding" name="ExtendAccessWSv1">
54+
<wsdlsoap:address location="http://tempuri.org/ExtendAccessWS/services/ExtendAccessWSv1"/>
55+
</wsdl:port>
56+
</wsdl:service>
57+
</wsdl:definitions>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
wsOIGNodeURL=t3://localhost:14000
2+
wsOIGUser=xelsysadm
3+
wsOIGPassword=YourSecurePassword
4+
wsExtendAccessNodeURL=t3://localhost:14000

0 commit comments

Comments
 (0)