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

The following examples show how to use com.sun.xml.internal.ws.api.databinding.MetadataReader. 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 File: DatabindingFactoryImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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 #2
Source File: JavaMethodImpl.java    From TencentKona-8 with 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 #3
Source File: EndpointFactory.java    From openjdk-8 with 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
Source File: DatabindingFactoryImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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 #5
Source File: EndpointFactory.java    From hottub with 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 #6
Source File: EndpointFactory.java    From openjdk-jdk9 with 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 #7
Source File: JavaMethodImpl.java    From openjdk-jdk8u with 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 #8
Source File: EndpointFactory.java    From openjdk-jdk8u-backup with 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 #9
Source File: EndpointFactory.java    From openjdk-jdk8u-backup with 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 #10
Source File: DatabindingFactoryImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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 #11
Source File: EndpointFactory.java    From jdk8u60 with 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 #12
Source File: DatabindingFactoryImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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 #13
Source File: EndpointFactory.java    From hottub with 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 #14
Source File: EndpointFactory.java    From openjdk-8-source with 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 #15
Source File: EndpointFactory.java    From openjdk-jdk8u-backup with 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 #16
Source File: EndpointImpl.java    From openjdk-jdk8u with 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 #17
Source File: DeploymentDescriptorParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 #18
Source File: WSServiceDelegate.java    From jdk8u60 with 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 #19
Source File: RuntimeModeler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static QName getPortName(Class<?> implClass, MetadataReader reader, String targetNamespace, boolean isStandard) {
    WebService webService = getAnnotation(WebService.class, implClass, reader);
    if (isStandard && webService == null) {
        throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
            implClass.getCanonicalName());
    }
    String name;
    if (webService != null && webService.portName().length() > 0) {
        name = webService.portName();
    } else if (webService != null && webService.name().length() > 0) {
        name = webService.name()+PORT;
    } else {
        name = implClass.getSimpleName()+PORT;
    }

    if (targetNamespace == null) {
        if (webService != null && webService.targetNamespace().length() > 0) {
            targetNamespace = webService.targetNamespace();
        } else {
            String packageName = null;
            if (implClass.getPackage() != null) {
                packageName = implClass.getPackage().getName();
            }
            if (packageName != null) {
                targetNamespace = getNamespace(packageName);
            }
            if (targetNamespace == null) {
                throw new RuntimeModelerException("runtime.modeler.no.package",
                    implClass.getName());
            }
        }

    }

    return new QName(targetNamespace, name);
}
 
Example #20
Source File: EndpointImpl.java    From openjdk-8-source with 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 #21
Source File: JavaMethodImpl.java    From openjdk-jdk8u-backup with 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 #22
Source File: RuntimeModeler.java    From openjdk-jdk8u with 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 #23
Source File: WSServiceDelegate.java    From openjdk-jdk8u with 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 #24
Source File: WSServiceDelegate.java    From openjdk-jdk9 with 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 #25
Source File: EndpointFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static MetadataReader getExternalMetadatReader(Class<?> implType, WSBinding binding) {
    com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef = binding.getFeature(
            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(implType.getClassLoader(), false);
    return null;
}
 
Example #26
Source File: RuntimeModeler.java    From jdk8u60 with 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 #27
Source File: RuntimeModeler.java    From openjdk-jdk8u-backup with 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 File: JavaMethodImpl.java    From hottub with 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 #29
Source File: EndpointFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static MetadataReader getExternalMetadatReader(Class<?> implType, WSBinding binding) {
    com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef = binding.getFeature(
            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(implType.getClassLoader(), false);
    return null;
}
 
Example #30
Source File: EndpointImpl.java    From openjdk-jdk9 with 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));
}