aoqi@0: /* aoqi@0: * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: package com.sun.xml.internal.ws.transport.http; aoqi@0: aoqi@0: import com.oracle.webservices.internal.api.databinding.DatabindingModeFeature; aoqi@0: import com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature; aoqi@0: import com.sun.istack.internal.NotNull; aoqi@0: import com.sun.xml.internal.ws.api.BindingID; aoqi@0: import com.sun.xml.internal.ws.api.WSBinding; aoqi@0: import com.sun.xml.internal.ws.api.databinding.MetadataReader; aoqi@0: import com.sun.xml.internal.ws.api.server.Container; aoqi@0: import com.sun.xml.internal.ws.api.server.SDDocumentSource; aoqi@0: import com.sun.xml.internal.ws.api.server.WSEndpoint; aoqi@0: import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; aoqi@0: import com.sun.xml.internal.ws.binding.WebServiceFeatureList; aoqi@0: aoqi@0: import com.sun.xml.internal.ws.handler.HandlerChainsModel; aoqi@0: import com.sun.xml.internal.ws.resources.ServerMessages; aoqi@0: import com.sun.xml.internal.ws.resources.WsservletMessages; aoqi@0: import com.sun.xml.internal.ws.server.EndpointFactory; aoqi@0: import com.sun.xml.internal.ws.server.ServerRtException; aoqi@0: import com.sun.xml.internal.ws.streaming.Attributes; aoqi@0: import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader; aoqi@0: import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil; aoqi@0: import com.sun.xml.internal.ws.util.HandlerAnnotationInfo; aoqi@0: import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException; aoqi@0: import com.sun.xml.internal.ws.util.xml.XmlUtil; aoqi@0: import org.xml.sax.EntityResolver; aoqi@0: aoqi@0: import javax.xml.namespace.QName; aoqi@0: import javax.xml.stream.XMLStreamConstants; aoqi@0: import javax.xml.stream.XMLStreamException; aoqi@0: import javax.xml.stream.XMLStreamReader; aoqi@0: import javax.xml.ws.WebServiceException; aoqi@0: import javax.xml.ws.WebServiceFeature; aoqi@0: import javax.xml.ws.http.HTTPBinding; aoqi@0: import javax.xml.ws.soap.MTOMFeature; aoqi@0: import javax.xml.ws.soap.SOAPBinding; aoqi@0: import java.io.File; aoqi@0: import java.io.FileInputStream; aoqi@0: import java.io.IOException; aoqi@0: import java.io.InputStream; aoqi@0: import java.net.MalformedURLException; aoqi@0: import java.net.URL; aoqi@0: import java.util.ArrayList; aoqi@0: import java.util.Arrays; aoqi@0: import java.util.HashMap; aoqi@0: import java.util.HashSet; aoqi@0: import java.util.List; aoqi@0: import java.util.Map; aoqi@0: import java.util.Set; aoqi@0: import java.util.logging.Level; aoqi@0: import java.util.logging.Logger; aoqi@0: aoqi@0: /** aoqi@0: * Parses {@code sun-jaxws.xml} into {@link WSEndpoint}. aoqi@0: *
aoqi@0: * aoqi@0: * Since {@code sun-jaxws.xml} captures more information than what {@link WSEndpoint} aoqi@0: * represents (in particular URL pattern and name), this class aoqi@0: * takes a parameterization 'A' so that the user of this parser can choose to aoqi@0: * create another type that wraps {@link WSEndpoint}. aoqi@0: * aoqi@0: * {@link HttpAdapter} and its derived type is used for this often, aoqi@0: * but it can be anything. aoqi@0: * aoqi@0: * @author WS Development Team aoqi@0: * @author Kohsuke Kawaguchi aoqi@0: */ aoqi@0: public class DeploymentDescriptorParser { aoqi@0: aoqi@0: public static final String NS_RUNTIME = "http://java.sun.com/xml/ns/jax-ws/ri/runtime"; aoqi@0: public static final String JAXWS_WSDL_DD_DIR = "WEB-INF/wsdl"; aoqi@0: aoqi@0: public static final QName QNAME_ENDPOINTS = new QName(NS_RUNTIME, "endpoints"); aoqi@0: public static final QName QNAME_ENDPOINT = new QName(NS_RUNTIME, "endpoint"); aoqi@0: public static final QName QNAME_EXT_METADA = new QName(NS_RUNTIME, "external-metadata"); aoqi@0: aoqi@0: public static final String ATTR_FILE = "file"; aoqi@0: public static final String ATTR_RESOURCE = "resource"; aoqi@0: aoqi@0: public static final String ATTR_VERSION = "version"; aoqi@0: public static final String ATTR_NAME = "name"; aoqi@0: public static final String ATTR_IMPLEMENTATION = "implementation"; aoqi@0: public static final String ATTR_WSDL = "wsdl"; aoqi@0: public static final String ATTR_SERVICE = "service"; aoqi@0: public static final String ATTR_PORT = "port"; aoqi@0: public static final String ATTR_URL_PATTERN = "url-pattern"; aoqi@0: public static final String ATTR_ENABLE_MTOM = "enable-mtom"; aoqi@0: public static final String ATTR_MTOM_THRESHOLD_VALUE = "mtom-threshold-value"; aoqi@0: public static final String ATTR_BINDING = "binding"; aoqi@0: public static final String ATTR_DATABINDING = "databinding"; aoqi@0: aoqi@0: public static final List