8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: IdentityServicesServlet.java,v 1.3 2009/01/05 23:53:38 veiming Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Portions Copyrighted [2011] [ForgeRock AS]
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.xml.rpc.server.http.JAXRPCServlet;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Provides implementation for returning WSDL.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Obtains the hostname, port, etc from Naming Service
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and should be aware of load balance i.e., sites.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpublic class IdentityServicesServlet extends JAXRPCServlet {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Obtain a pointer to the servlet context
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void init(ServletConfig config) throws ServletException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Checks for "wsdl" query parameter and returns the wsdl
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster HttpServletResponse response) throws ServletException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((queryParam != null) && (queryParam.equalsIgnoreCase("wsdl"))) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Check if the wsdl is cached
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Read the wsdl from deployment
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster InputStream is = servletCtx.getResourceAsStream(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Replace host, port & protocols
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster int start = wsdl.indexOf("REPLACE_WITH_ACTUAL_URL");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Debug and return null