Java Code Examples for com.sun.xml.internal.ws.api.databinding.MetadataReader

The following examples show how to use com.sun.xml.internal.ws.api.databinding.MetadataReader. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: TencentKona-8   Source File: JavaMethodImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void setWsaActions(MetadataReader metadataReader) {
    Action action = (metadataReader != null)? metadataReader.getAnnotation(Action.class, seiMethod):seiMethod.getAnnotation(Action.class);
    if(action != null) {
        inputAction = action.input();
        outputAction = action.output();
    }

    //@Action(input) =="", get it from @WebMethod(action)
    WebMethod webMethod = (metadataReader != null)? metadataReader.getAnnotation(WebMethod.class, seiMethod):seiMethod.getAnnotation(WebMethod.class);
    soapAction = "";
    if (webMethod != null )
        soapAction = webMethod.action();
    if(!soapAction.equals("")) {
        //non-empty soapAction
        if(inputAction.equals(""))
            // set input action to non-empty soapAction
            inputAction = soapAction;
        else if(!inputAction.equals(soapAction)){
            //both are explicitly set via annotations, make sure @Action == @WebMethod.action
            //http://java.net/jira/browse/JAX_WS-1108
          //throw new WebServiceException("@Action and @WebMethod(action=\"\" does not match on operation "+ method.getName());
        }
    }
}
 
Example 2
Source Project: openjdk-jdk9   Source File: EndpointFactory.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static @NotNull QName getDefaultPortName(QName serviceName, Class<?> implType, boolean isStandard, MetadataReader metadataReader) {
    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }
    QName portName;
    WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, implType);
    if (wsProvider!=null) {
        String tns = wsProvider.targetNamespace();
        String local = wsProvider.portName();
        portName = new QName(tns, local);
    } else {
        portName = RuntimeModeler.getPortName(implType, metadataReader, serviceName.getNamespaceURI(), isStandard);
    }
    assert portName != null;
    return portName;
}
 
Example 3
Source Project: hottub   Source File: EndpointFactory.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the wsdl from @WebService, or @WebServiceProvider annotation using
 * wsdlLocation element.
 *
 * @param implType
 *      endpoint implementation class
 *      make sure that you called {@link #verifyImplementorClass} on it.
 * @return wsdl if there is wsdlLocation, else null
 */
public static @Nullable String getWsdlLocation(Class<?> implType, MetadataReader metadataReader) {

    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }

    WebService ws = metadataReader.getAnnotation(WebService.class, implType);
    if (ws != null) {
        return nullIfEmpty(ws.wsdlLocation());
    } else {
        WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
        assert wsProvider != null;
        return nullIfEmpty(wsProvider.wsdlLocation());
    }
}
 
Example 4
public static @NotNull QName getDefaultServiceName(Class<?> implType, boolean isStandard, MetadataReader metadataReader) {
    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }
    QName serviceName;
    WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, implType);
    if (wsProvider!=null) {
        String tns = wsProvider.targetNamespace();
        String local = wsProvider.serviceName();
        serviceName = new QName(tns, local);
    } else {
        serviceName = RuntimeModeler.getServiceName(implType, metadataReader, isStandard);
    }
    assert serviceName != null;
    return serviceName;
}
 
Example 5
public Builder property(String name, Object value) {
    config.properties().put(name, value);
    if (isfor(BindingID.class, name, value)) {
        config.getMappingInfo().setBindingID((BindingID)value);
    }
    if (isfor(WSBinding.class, name, value)) {
        config.setWSBinding((WSBinding)value);
    }
    if (isfor(WSDLPort.class, name, value)) {
        config.setWsdlPort((WSDLPort)value);
    }
    if (isfor(MetadataReader.class, name, value)) {
        config.setMetadataReader((MetadataReader)value);
    }
    return this;
}
 
Example 6
public Builder property(String name, Object value) {
    config.properties().put(name, value);
    if (isfor(BindingID.class, name, value)) {
        config.getMappingInfo().setBindingID((BindingID)value);
    }
    if (isfor(WSBinding.class, name, value)) {
        config.setWSBinding((WSBinding)value);
    }
    if (isfor(WSDLPort.class, name, value)) {
        config.setWsdlPort((WSDLPort)value);
    }
    if (isfor(MetadataReader.class, name, value)) {
        config.setMetadataReader((MetadataReader)value);
    }
    return this;
}
 
Example 7
/**
 * Returns the wsdl from @WebService, or @WebServiceProvider annotation using
 * wsdlLocation element.
 *
 * @param implType
 *      endpoint implementation class
 *      make sure that you called {@link #verifyImplementorClass} on it.
 * @return wsdl if there is wsdlLocation, else null
 */
public static @Nullable String getWsdlLocation(Class<?> implType, MetadataReader metadataReader) {

    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }

    WebService ws = metadataReader.getAnnotation(WebService.class, implType);
    if (ws != null) {
        return nullIfEmpty(ws.wsdlLocation());
    } else {
        WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
        assert wsProvider != null;
        return nullIfEmpty(wsProvider.wsdlLocation());
    }
}
 
Example 8
public static @NotNull QName getDefaultServiceName(Class<?> implType, boolean isStandard, MetadataReader metadataReader) {
    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }
    QName serviceName;
    WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, implType);
    if (wsProvider!=null) {
        String tns = wsProvider.targetNamespace();
        String local = wsProvider.serviceName();
        serviceName = new QName(tns, local);
    } else {
        serviceName = RuntimeModeler.getServiceName(implType, metadataReader, isStandard);
    }
    assert serviceName != null;
    return serviceName;
}
 
Example 9
Source Project: hottub   Source File: EndpointFactory.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static @NotNull QName getDefaultServiceName(Class<?> implType, boolean isStandard, MetadataReader metadataReader) {
    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }
    QName serviceName;
    WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, implType);
    if (wsProvider!=null) {
        String tns = wsProvider.targetNamespace();
        String local = wsProvider.serviceName();
        serviceName = new QName(tns, local);
    } else {
        serviceName = RuntimeModeler.getServiceName(implType, metadataReader, isStandard);
    }
    assert serviceName != null;
    return serviceName;
}
 
Example 10
Source Project: jdk8u60   Source File: EndpointFactory.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static @NotNull QName getDefaultPortName(QName serviceName, Class<?> implType, boolean isStandard, MetadataReader metadataReader) {
    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }
    QName portName;
    WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, implType);
    if (wsProvider!=null) {
        String tns = wsProvider.targetNamespace();
        String local = wsProvider.portName();
        portName = new QName(tns, local);
    } else {
        portName = RuntimeModeler.getPortName(implType, metadataReader, serviceName.getNamespaceURI(), isStandard);
    }
    assert portName != null;
    return portName;
}
 
Example 11
public Builder property(String name, Object value) {
    config.properties().put(name, value);
    if (isfor(BindingID.class, name, value)) {
        config.getMappingInfo().setBindingID((BindingID)value);
    }
    if (isfor(WSBinding.class, name, value)) {
        config.setWSBinding((WSBinding)value);
    }
    if (isfor(WSDLPort.class, name, value)) {
        config.setWsdlPort((WSDLPort)value);
    }
    if (isfor(MetadataReader.class, name, value)) {
        config.setMetadataReader((MetadataReader)value);
    }
    return this;
}
 
Example 12
public static @NotNull QName getDefaultPortName(QName serviceName, Class<?> implType, boolean isStandard, MetadataReader metadataReader) {
    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }
    QName portName;
    WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, implType);
    if (wsProvider!=null) {
        String tns = wsProvider.targetNamespace();
        String local = wsProvider.portName();
        portName = new QName(tns, local);
    } else {
        portName = RuntimeModeler.getPortName(implType, metadataReader, serviceName.getNamespaceURI(), isStandard);
    }
    assert portName != null;
    return portName;
}
 
Example 13
Source Project: openjdk-jdk8u   Source File: JavaMethodImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void setWsaActions(MetadataReader metadataReader) {
    Action action = (metadataReader != null)? metadataReader.getAnnotation(Action.class, seiMethod):seiMethod.getAnnotation(Action.class);
    if(action != null) {
        inputAction = action.input();
        outputAction = action.output();
    }

    //@Action(input) =="", get it from @WebMethod(action)
    WebMethod webMethod = (metadataReader != null)? metadataReader.getAnnotation(WebMethod.class, seiMethod):seiMethod.getAnnotation(WebMethod.class);
    soapAction = "";
    if (webMethod != null )
        soapAction = webMethod.action();
    if(!soapAction.equals("")) {
        //non-empty soapAction
        if(inputAction.equals(""))
            // set input action to non-empty soapAction
            inputAction = soapAction;
        else if(!inputAction.equals(soapAction)){
            //both are explicitly set via annotations, make sure @Action == @WebMethod.action
            //http://java.net/jira/browse/JAX_WS-1108
          //throw new WebServiceException("@Action and @WebMethod(action=\"\" does not match on operation "+ method.getName());
        }
    }
}
 
Example 14
Source Project: openjdk-8   Source File: EndpointFactory.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the wsdl from @WebService, or @WebServiceProvider annotation using
 * wsdlLocation element.
 *
 * @param implType
 *      endpoint implementation class
 *      make sure that you called {@link #verifyImplementorClass} on it.
 * @return wsdl if there is wsdlLocation, else null
 */
public static @Nullable String getWsdlLocation(Class<?> implType, MetadataReader metadataReader) {

    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }

    WebService ws = metadataReader.getAnnotation(WebService.class, implType);
    if (ws != null) {
        return nullIfEmpty(ws.wsdlLocation());
    } else {
        WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
        assert wsProvider != null;
        return nullIfEmpty(wsProvider.wsdlLocation());
    }
}
 
Example 15
public Builder property(String name, Object value) {
    config.properties().put(name, value);
    if (isfor(BindingID.class, name, value)) {
        config.getMappingInfo().setBindingID((BindingID)value);
    }
    if (isfor(WSBinding.class, name, value)) {
        config.setWSBinding((WSBinding)value);
    }
    if (isfor(WSDLPort.class, name, value)) {
        config.setWsdlPort((WSDLPort)value);
    }
    if (isfor(MetadataReader.class, name, value)) {
        config.setMetadataReader((MetadataReader)value);
    }
    return this;
}
 
Example 16
Source Project: openjdk-8   Source File: RuntimeModeler.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static QName getPortTypeName(Class<?> implOrSeiClass, String tns, MetadataReader reader){
    assert(implOrSeiClass != null);
    WebService webService = getAnnotation(WebService.class, implOrSeiClass, reader);
    Class<?> clazz = implOrSeiClass;
    if (webService == null)
            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
                                       implOrSeiClass.getCanonicalName());

    if (!implOrSeiClass.isInterface()) {
        String epi = webService.endpointInterface();
        if (epi.length() > 0) {
            try {
                clazz = Thread.currentThread().getContextClassLoader().loadClass(epi);
            } catch (ClassNotFoundException e) {
                throw new RuntimeModelerException("runtime.modeler.class.not.found", epi);
            }
            WebService ws = getAnnotation(WebService.class, clazz, reader);
            if (ws == null) {
                throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
                                    webService.endpointInterface());
            }
        }
    }

    webService = getAnnotation(WebService.class, clazz, reader);
    String name = webService.name();
    if(name.length() == 0){
        name = clazz.getSimpleName();
    }
    if (tns == null || "".equals(tns.trim())) tns = webService.targetNamespace();
    if (tns.length() == 0)
        tns = getNamespace(clazz.getPackage().getName());
    if (tns == null) {
        throw new RuntimeModelerException("runtime.modeler.no.package", clazz.getName());
    }
    return new QName(tns, name);
}
 
Example 17
Source Project: TencentKona-8   Source File: JavaMethodImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param owner
 * @param method : Implementation class method
 * @param seiMethod : corresponding SEI Method.
 *                  Is there is no SEI, it should be Implementation class method
 */
public JavaMethodImpl(AbstractSEIModelImpl owner, Method method, Method seiMethod, MetadataReader metadataReader) {
    this.owner = owner;
    this.method = method;
    this.seiMethod = seiMethod;
    setWsaActions(metadataReader);
}
 
Example 18
Source Project: openjdk-jdk9   Source File: EndpointImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets wsdl from @WebService or @WebServiceProvider
 */
private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) {
    // Takes care of @WebService, @WebServiceProvider's wsdlLocation
    EndpointFactory.verifyImplementorClass(implClass, metadataReader);
    String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader);
    if (wsdlLocation != null) {
        return SDDocumentSource.create(implClass, wsdlLocation);
    }
    return null;
}
 
Example 19
Source Project: openjdk-8   Source File: EndpointImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets wsdl from @WebService or @WebServiceProvider
 */
private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) {
    // Takes care of @WebService, @WebServiceProvider's wsdlLocation
    EndpointFactory.verifyImplementorClass(implClass, metadataReader);
    String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader);
    if (wsdlLocation != null) {
        ClassLoader cl = implClass.getClassLoader();
        URL url = cl.getResource(wsdlLocation);
        if (url != null) {
            return SDDocumentSource.create(url);
        }
        throw new ServerRtException("cannot.load.wsdl", wsdlLocation);
    }
    return null;
}
 
Example 20
private MetadataReader getMetadadaReader(WebServiceFeatureList features, ClassLoader classLoader) {
    if (features == null) return null;
    com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef =
            features.get(com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature.class);
    // TODO-Miran: would it be necessary to disable secure xml processing?
    if (ef != null)
        return ef.getMetadataReader(classLoader, false);
    return null;
}
 
Example 21
Source Project: openjdk-8   Source File: WSServiceDelegate.java    License: GNU General Public License v2.0 5 votes vote down vote up
private MetadataReader getMetadadaReader(WebServiceFeatureList features, ClassLoader classLoader) {
    if (features == null) return null;
    com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef =
            features.get(com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature.class);
    // TODO-Miran: would it be necessary to disable secure xml processing?
    if (ef != null)
        return ef.getMetadataReader(classLoader, false);
    return null;
}
 
Example 22
/**
 * Checks the deployment descriptor or {@link @WebServiceProvider} annotation
 * to see if it points to any WSDL. If so, returns the {@link SDDocumentSource}.
 *
 * @return The pointed WSDL, if any. Otherwise null.
 */
private SDDocumentSource getPrimaryWSDL(XMLStreamReader xsr, Attributes attrs, Class<?> implementorClass, MetadataReader metadataReader) {

    String wsdlFile = getAttribute(attrs, ATTR_WSDL);
    if (wsdlFile == null) {
        wsdlFile = EndpointFactory.getWsdlLocation(implementorClass, metadataReader);
    }

    if (wsdlFile != null) {
        if (!wsdlFile.startsWith(JAXWS_WSDL_DD_DIR)) {
            logger.log(Level.WARNING, "Ignoring wrong wsdl={0}. It should start with {1}. Going to generate and publish a new WSDL.", new Object[]{wsdlFile, JAXWS_WSDL_DD_DIR});
            return null;
        }

        URL wsdl;
        try {
            wsdl = loader.getResource('/' + wsdlFile);
        } catch (MalformedURLException e) {
            throw new LocatableWebServiceException(
                    ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), e, xsr);
        }
        if (wsdl == null) {
            throw new LocatableWebServiceException(
                    ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), xsr);
        }
        SDDocumentSource docInfo = docs.get(wsdl.toExternalForm());
        assert docInfo != null;
        return docInfo;
    }

    return null;
}
 
Example 23
Source Project: hottub   Source File: EndpointImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void createEndpoint(String urlPattern) {
    // Checks permission for "publishEndpoint"
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(ENDPOINT_PUBLISH_PERMISSION);
    }

    // See if HttpServer implementation is available
    try {
        Class.forName("com.sun.net.httpserver.HttpServer");
    } catch (Exception e) {
        throw new UnsupportedOperationException("Couldn't load light weight http server", e);
    }
    container = getContainer();
    MetadataReader metadataReader = EndpointFactory.getExternalMetadatReader(implClass, binding);
    WSEndpoint wse = WSEndpoint.create(
            implClass, true,
            invoker,
            getProperty(QName.class, Endpoint.WSDL_SERVICE),
            getProperty(QName.class, Endpoint.WSDL_PORT),
            container,
            binding,
            getPrimaryWsdl(metadataReader),
            buildDocList(),
            (EntityResolver) null,
            false
    );
    // Don't load HttpEndpoint class before as it may load HttpServer classes
    actualEndpoint = new HttpEndpoint(executor, getAdapter(wse, urlPattern));
}
 
Example 24
Source Project: hottub   Source File: RuntimeModeler.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static QName getServiceName(Class<?> implClass, MetadataReader reader, boolean isStandard) {
    if (implClass.isInterface()) {
        throw new RuntimeModelerException("runtime.modeler.cannot.get.serviceName.from.interface",
                                implClass.getCanonicalName());
    }

    String name = implClass.getSimpleName()+SERVICE;
    String packageName = "";
    if (implClass.getPackage() != null)
        packageName = implClass.getPackage().getName();

    WebService webService = getAnnotation(WebService.class, implClass, reader);
    if (isStandard && webService == null) {
        throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
            implClass.getCanonicalName());
    }
    if (webService != null && webService.serviceName().length() > 0) {
        name = webService.serviceName();
    }
    String targetNamespace = getNamespace(packageName);
    if (webService != null && webService.targetNamespace().length() > 0) {
        targetNamespace = webService.targetNamespace();
    } else if (targetNamespace == null) {
        throw new RuntimeModelerException("runtime.modeler.no.package",
            implClass.getName());
    }
    return new QName(targetNamespace, name);
}
 
Example 25
Source Project: hottub   Source File: JavaMethodImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param owner
 * @param method : Implementation class method
 * @param seiMethod : corresponding SEI Method.
 *                  Is there is no SEI, it should be Implementation class method
 */
public JavaMethodImpl(AbstractSEIModelImpl owner, Method method, Method seiMethod, MetadataReader metadataReader) {
    this.owner = owner;
    this.method = method;
    this.seiMethod = seiMethod;
    setWsaActions(metadataReader);
}
 
Example 26
public static QName getPortTypeName(Class<?> implOrSeiClass, String tns, MetadataReader reader){
    assert(implOrSeiClass != null);
    WebService webService = getAnnotation(WebService.class, implOrSeiClass, reader);
    Class<?> clazz = implOrSeiClass;
    if (webService == null)
            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
                                       implOrSeiClass.getCanonicalName());

    if (!implOrSeiClass.isInterface()) {
        String epi = webService.endpointInterface();
        if (epi.length() > 0) {
            try {
                clazz = Thread.currentThread().getContextClassLoader().loadClass(epi);
            } catch (ClassNotFoundException e) {
                throw new RuntimeModelerException("runtime.modeler.class.not.found", epi);
            }
            WebService ws = getAnnotation(WebService.class, clazz, reader);
            if (ws == null) {
                throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
                                    webService.endpointInterface());
            }
        }
    }

    webService = getAnnotation(WebService.class, clazz, reader);
    String name = webService.name();
    if(name.length() == 0){
        name = clazz.getSimpleName();
    }
    if (tns == null || "".equals(tns.trim())) tns = webService.targetNamespace();
    if (tns.length() == 0)
        tns = getNamespace(clazz.getPackage().getName());
    if (tns == null) {
        throw new RuntimeModelerException("runtime.modeler.no.package", clazz.getName());
    }
    return new QName(tns, name);
}
 
Example 27
Source Project: jdk8u60   Source File: RuntimeModeler.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static QName getPortTypeName(Class<?> implOrSeiClass, String tns, MetadataReader reader){
    assert(implOrSeiClass != null);
    WebService webService = getAnnotation(WebService.class, implOrSeiClass, reader);
    Class<?> clazz = implOrSeiClass;
    if (webService == null)
            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
                                       implOrSeiClass.getCanonicalName());

    if (!implOrSeiClass.isInterface()) {
        String epi = webService.endpointInterface();
        if (epi.length() > 0) {
            try {
                clazz = Thread.currentThread().getContextClassLoader().loadClass(epi);
            } catch (ClassNotFoundException e) {
                throw new RuntimeModelerException("runtime.modeler.class.not.found", epi);
            }
            WebService ws = getAnnotation(WebService.class, clazz, reader);
            if (ws == null) {
                throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
                                    webService.endpointInterface());
            }
        }
    }

    webService = getAnnotation(WebService.class, clazz, reader);
    String name = webService.name();
    if(name.length() == 0){
        name = clazz.getSimpleName();
    }
    if (tns == null || "".equals(tns.trim())) tns = webService.targetNamespace();
    if (tns.length() == 0)
        tns = getNamespace(clazz.getPackage().getName());
    if (tns == null) {
        throw new RuntimeModelerException("runtime.modeler.no.package", clazz.getName());
    }
    return new QName(tns, name);
}
 
Example 28
Source Project: jdk8u60   Source File: WSServiceDelegate.java    License: GNU General Public License v2.0 5 votes vote down vote up
private MetadataReader getMetadadaReader(WebServiceFeatureList features, ClassLoader classLoader) {
    if (features == null) return null;
    com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef =
            features.get(com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature.class);
    // TODO-Miran: would it be necessary to disable secure xml processing?
    if (ef != null)
        return ef.getMetadataReader(classLoader, false);
    return null;
}
 
Example 29
private MetadataReader getMetadadaReader(WebServiceFeatureList features, ClassLoader classLoader) {
    if (features == null) return null;
    com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef =
            features.get(com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature.class);
    // TODO-Miran: would it be necessary to disable secure xml processing?
    if (ef != null)
        return ef.getMetadataReader(classLoader, false);
    return null;
}
 
Example 30
Source Project: openjdk-jdk9   Source File: EndpointImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void createEndpoint(String urlPattern) {
    // Checks permission for "publishEndpoint"
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(ENDPOINT_PUBLISH_PERMISSION);
    }

    // See if HttpServer implementation is available
    try {
        Class.forName("com.sun.net.httpserver.HttpServer");
    } catch (Exception e) {
        throw new UnsupportedOperationException("Couldn't load light weight http server", e);
    }
    container = getContainer();
    MetadataReader metadataReader = EndpointFactory.getExternalMetadatReader(implClass, binding);
    WSEndpoint wse = WSEndpoint.create(
            implClass, true,
            invoker,
            getProperty(QName.class, Endpoint.WSDL_SERVICE),
            getProperty(QName.class, Endpoint.WSDL_PORT),
            container,
            binding,
            getPrimaryWsdl(metadataReader),
            buildDocList(),
            (EntityResolver) null,
            false
    );
    // Don't load HttpEndpoint class before as it may load HttpServer classes
    actualEndpoint = new HttpEndpoint(executor, getAdapter(wse, urlPattern));
}