Java Code Examples for javax.jws.soap.SOAPBinding#use()
The following examples show how to use
javax.jws.soap.SOAPBinding#use() .
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: RuntimeModeler.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>. * @return the runtime model for the <code>portClass</code>. */ public AbstractSEIModelImpl buildRuntimeModel() { model = new SOAPSEIModel(features); model.contractClass = config.getContractClass(); model.endpointClass = config.getEndpointClass(); model.classLoader = this.classLoader; model.wsBinding = wsBinding; model.databindingInfo.setWsdlURL(config.getWsdlURL()); model.databindingInfo.properties().putAll(config.properties()); if (model.contractClass == null) model.contractClass = portClass; if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass; Class<?> seiClass = portClass; metadataReader.getProperties(model.databindingInfo.properties(), portClass); WebService webService = getAnnotation(portClass, WebService.class); if (webService == null) { throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation", portClass.getCanonicalName()); } Class<?> seiFromConfig = configEndpointInterface(); if (webService.endpointInterface().length() > 0 || seiFromConfig != null) { if (seiFromConfig != null) { seiClass = seiFromConfig; } else { seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface())); } model.contractClass = seiClass; model.endpointClass = portClass; WebService seiService = getAnnotation(seiClass, WebService.class); if (seiService == null) { throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice", webService.endpointInterface()); } //check if @SOAPBinding is defined on the impl class SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class); SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class); if(sbPortClass != null){ if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){ logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName())); } } } if (serviceName == null) serviceName = getServiceName(portClass, metadataReader); model.setServiceQName(serviceName); // String portLocalName = portClass.getSimpleName()+PORT; // if (webService.portName().length() >0) { // portLocalName = webService.portName(); // } else if (webService.name().length() >0) { // portLocalName = webService.name()+PORT; // } // // if (portName == null) // portName = new QName(serviceName.getNamespaceURI(), portLocalName); // if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) { // throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch", // serviceName, portName); // } if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI()); model.setPortName(portName); // Check if databinding is overridden in annotation. com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class); if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value()); processClass(seiClass); if (model.getJavaMethods().size() == 0) throw new RuntimeModelerException("runtime.modeler.no.operations", portClass.getName()); model.postProcess(); // Make the configured databinding mode available to the // DatabindingConfig. config.properties().put(BindingContext.class.getName(), model.bindingContext); // TODO: this needs to be fixed properly -- // when we are building RuntimeModel first before building WSDLModel, // we still need to do this correctly if(binding!=null) model.freeze(binding); return model; }
Example 2
Source File: RuntimeModeler.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>. * @return the runtime model for the <code>portClass</code>. */ public AbstractSEIModelImpl buildRuntimeModel() { model = new SOAPSEIModel(features); model.contractClass = config.getContractClass(); model.endpointClass = config.getEndpointClass(); model.classLoader = this.classLoader; model.wsBinding = wsBinding; model.databindingInfo.setWsdlURL(config.getWsdlURL()); model.databindingInfo.properties().putAll(config.properties()); if (model.contractClass == null) model.contractClass = portClass; if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass; Class<?> seiClass = portClass; metadataReader.getProperties(model.databindingInfo.properties(), portClass); WebService webService = getAnnotation(portClass, WebService.class); if (webService == null) { throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation", portClass.getCanonicalName()); } Class<?> seiFromConfig = configEndpointInterface(); if (webService.endpointInterface().length() > 0 || seiFromConfig != null) { if (seiFromConfig != null) { seiClass = seiFromConfig; } else { seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface())); } model.contractClass = seiClass; model.endpointClass = portClass; WebService seiService = getAnnotation(seiClass, WebService.class); if (seiService == null) { throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice", webService.endpointInterface()); } //check if @SOAPBinding is defined on the impl class SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class); SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class); if(sbPortClass != null){ if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){ logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName())); } } } if (serviceName == null) serviceName = getServiceName(portClass, metadataReader); model.setServiceQName(serviceName); // String portLocalName = portClass.getSimpleName()+PORT; // if (webService.portName().length() >0) { // portLocalName = webService.portName(); // } else if (webService.name().length() >0) { // portLocalName = webService.name()+PORT; // } // // if (portName == null) // portName = new QName(serviceName.getNamespaceURI(), portLocalName); // if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) { // throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch", // serviceName, portName); // } if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI()); model.setPortName(portName); // Check if databinding is overridden in annotation. com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class); if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value()); processClass(seiClass); if (model.getJavaMethods().size() == 0) throw new RuntimeModelerException("runtime.modeler.no.operations", portClass.getName()); model.postProcess(); // Make the configured databinding mode available to the // DatabindingConfig. config.properties().put(BindingContext.class.getName(), model.bindingContext); // TODO: this needs to be fixed properly -- // when we are building RuntimeModel first before building WSDLModel, // we still need to do this correctly if(binding!=null) model.freeze(binding); return model; }
Example 3
Source File: RuntimeModeler.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>. * @return the runtime model for the <code>portClass</code>. */ public AbstractSEIModelImpl buildRuntimeModel() { model = new SOAPSEIModel(features); model.contractClass = config.getContractClass(); model.endpointClass = config.getEndpointClass(); model.classLoader = this.classLoader; model.wsBinding = wsBinding; model.databindingInfo.setWsdlURL(config.getWsdlURL()); model.databindingInfo.properties().putAll(config.properties()); if (model.contractClass == null) model.contractClass = portClass; if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass; Class<?> seiClass = portClass; metadataReader.getProperties(model.databindingInfo.properties(), portClass); WebService webService = getAnnotation(portClass, WebService.class); if (webService == null) { throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation", portClass.getCanonicalName()); } Class<?> seiFromConfig = configEndpointInterface(); if (webService.endpointInterface().length() > 0 || seiFromConfig != null) { if (seiFromConfig != null) { seiClass = seiFromConfig; } else { seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface())); } model.contractClass = seiClass; model.endpointClass = portClass; WebService seiService = getAnnotation(seiClass, WebService.class); if (seiService == null) { throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice", webService.endpointInterface()); } //check if @SOAPBinding is defined on the impl class SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class); SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class); if(sbPortClass != null){ if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){ logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName())); } } } if (serviceName == null) serviceName = getServiceName(portClass, metadataReader); model.setServiceQName(serviceName); // String portLocalName = portClass.getSimpleName()+PORT; // if (webService.portName().length() >0) { // portLocalName = webService.portName(); // } else if (webService.name().length() >0) { // portLocalName = webService.name()+PORT; // } // // if (portName == null) // portName = new QName(serviceName.getNamespaceURI(), portLocalName); // if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) { // throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch", // serviceName, portName); // } if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI()); model.setPortName(portName); // Check if databinding is overridden in annotation. com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class); if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value()); processClass(seiClass); if (model.getJavaMethods().size() == 0) throw new RuntimeModelerException("runtime.modeler.no.operations", portClass.getName()); model.postProcess(); // Make the configured databinding mode available to the // DatabindingConfig. config.properties().put(BindingContext.class.getName(), model.bindingContext); // TODO: this needs to be fixed properly -- // when we are building RuntimeModel first before building WSDLModel, // we still need to do this correctly if(binding!=null) model.freeze(binding); return model; }
Example 4
Source File: RuntimeModeler.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>. * @return the runtime model for the <code>portClass</code>. */ public AbstractSEIModelImpl buildRuntimeModel() { model = new SOAPSEIModel(features); model.contractClass = config.getContractClass(); model.endpointClass = config.getEndpointClass(); model.classLoader = this.classLoader; model.wsBinding = wsBinding; model.databindingInfo.setWsdlURL(config.getWsdlURL()); model.databindingInfo.properties().putAll(config.properties()); if (model.contractClass == null) model.contractClass = portClass; if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass; Class<?> seiClass = portClass; metadataReader.getProperties(model.databindingInfo.properties(), portClass); WebService webService = getAnnotation(portClass, WebService.class); if (webService == null) { throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation", portClass.getCanonicalName()); } Class<?> seiFromConfig = configEndpointInterface(); if (webService.endpointInterface().length() > 0 || seiFromConfig != null) { if (seiFromConfig != null) { seiClass = seiFromConfig; } else { seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface())); } model.contractClass = seiClass; model.endpointClass = portClass; WebService seiService = getAnnotation(seiClass, WebService.class); if (seiService == null) { throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice", webService.endpointInterface()); } //check if @SOAPBinding is defined on the impl class SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class); SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class); if(sbPortClass != null){ if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){ logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName())); } } } if (serviceName == null) serviceName = getServiceName(portClass, metadataReader); model.setServiceQName(serviceName); // String portLocalName = portClass.getSimpleName()+PORT; // if (webService.portName().length() >0) { // portLocalName = webService.portName(); // } else if (webService.name().length() >0) { // portLocalName = webService.name()+PORT; // } // // if (portName == null) // portName = new QName(serviceName.getNamespaceURI(), portLocalName); // if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) { // throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch", // serviceName, portName); // } if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI()); model.setPortName(portName); // Check if databinding is overridden in annotation. com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class); if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value()); processClass(seiClass); if (model.getJavaMethods().size() == 0) throw new RuntimeModelerException("runtime.modeler.no.operations", portClass.getName()); model.postProcess(); // Make the configured databinding mode available to the // DatabindingConfig. config.properties().put(BindingContext.class.getName(), model.bindingContext); // TODO: this needs to be fixed properly -- // when we are building RuntimeModel first before building WSDLModel, // we still need to do this correctly if(binding!=null) model.freeze(binding); return model; }
Example 5
Source File: RuntimeModeler.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>. * @return the runtime model for the <code>portClass</code>. */ public AbstractSEIModelImpl buildRuntimeModel() { model = new SOAPSEIModel(features); model.contractClass = config.getContractClass(); model.endpointClass = config.getEndpointClass(); model.classLoader = this.classLoader; model.wsBinding = wsBinding; model.databindingInfo.setWsdlURL(config.getWsdlURL()); model.databindingInfo.properties().putAll(config.properties()); if (model.contractClass == null) model.contractClass = portClass; if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass; Class<?> seiClass = portClass; metadataReader.getProperties(model.databindingInfo.properties(), portClass); WebService webService = getAnnotation(portClass, WebService.class); if (webService == null) { throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation", portClass.getCanonicalName()); } Class<?> seiFromConfig = configEndpointInterface(); if (webService.endpointInterface().length() > 0 || seiFromConfig != null) { if (seiFromConfig != null) { seiClass = seiFromConfig; } else { seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface())); } model.contractClass = seiClass; model.endpointClass = portClass; WebService seiService = getAnnotation(seiClass, WebService.class); if (seiService == null) { throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice", webService.endpointInterface()); } //check if @SOAPBinding is defined on the impl class SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class); SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class); if(sbPortClass != null){ if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){ logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName())); } } } if (serviceName == null) serviceName = getServiceName(portClass, metadataReader); model.setServiceQName(serviceName); // String portLocalName = portClass.getSimpleName()+PORT; // if (webService.portName().length() >0) { // portLocalName = webService.portName(); // } else if (webService.name().length() >0) { // portLocalName = webService.name()+PORT; // } // // if (portName == null) // portName = new QName(serviceName.getNamespaceURI(), portLocalName); // if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) { // throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch", // serviceName, portName); // } if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI()); model.setPortName(portName); // Check if databinding is overridden in annotation. com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class); if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value()); processClass(seiClass); if (model.getJavaMethods().size() == 0) throw new RuntimeModelerException("runtime.modeler.no.operations", portClass.getName()); model.postProcess(); // Make the configured databinding mode available to the // DatabindingConfig. config.properties().put(BindingContext.class.getName(), model.bindingContext); // TODO: this needs to be fixed properly -- // when we are building RuntimeModel first before building WSDLModel, // we still need to do this correctly if(binding!=null) model.freeze(binding); return model; }
Example 6
Source File: RuntimeModeler.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>. * @return the runtime model for the <code>portClass</code>. */ public AbstractSEIModelImpl buildRuntimeModel() { model = new SOAPSEIModel(features); model.contractClass = config.getContractClass(); model.endpointClass = config.getEndpointClass(); model.classLoader = this.classLoader; model.wsBinding = wsBinding; model.databindingInfo.setWsdlURL(config.getWsdlURL()); model.databindingInfo.properties().putAll(config.properties()); if (model.contractClass == null) model.contractClass = portClass; if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass; Class<?> seiClass = portClass; metadataReader.getProperties(model.databindingInfo.properties(), portClass); WebService webService = getAnnotation(portClass, WebService.class); if (webService == null) { throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation", portClass.getCanonicalName()); } Class<?> seiFromConfig = configEndpointInterface(); if (webService.endpointInterface().length() > 0 || seiFromConfig != null) { if (seiFromConfig != null) { seiClass = seiFromConfig; } else { seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface())); } model.contractClass = seiClass; model.endpointClass = portClass; WebService seiService = getAnnotation(seiClass, WebService.class); if (seiService == null) { throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice", webService.endpointInterface()); } //check if @SOAPBinding is defined on the impl class SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class); SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class); if(sbPortClass != null){ if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){ logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName())); } } } if (serviceName == null) serviceName = getServiceName(portClass, metadataReader); model.setServiceQName(serviceName); // String portLocalName = portClass.getSimpleName()+PORT; // if (webService.portName().length() >0) { // portLocalName = webService.portName(); // } else if (webService.name().length() >0) { // portLocalName = webService.name()+PORT; // } // // if (portName == null) // portName = new QName(serviceName.getNamespaceURI(), portLocalName); // if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) { // throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch", // serviceName, portName); // } if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI()); model.setPortName(portName); // Check if databinding is overridden in annotation. com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class); if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value()); processClass(seiClass); if (model.getJavaMethods().size() == 0) throw new RuntimeModelerException("runtime.modeler.no.operations", portClass.getName()); model.postProcess(); // Make the configured databinding mode available to the // DatabindingConfig. config.properties().put(BindingContext.class.getName(), model.bindingContext); // TODO: this needs to be fixed properly -- // when we are building RuntimeModel first before building WSDLModel, // we still need to do this correctly if(binding!=null) model.freeze(binding); return model; }
Example 7
Source File: RuntimeModeler.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>. * @return the runtime model for the <code>portClass</code>. */ public AbstractSEIModelImpl buildRuntimeModel() { model = new SOAPSEIModel(features); model.contractClass = config.getContractClass(); model.endpointClass = config.getEndpointClass(); model.classLoader = this.classLoader; model.wsBinding = wsBinding; model.databindingInfo.setWsdlURL(config.getWsdlURL()); model.databindingInfo.properties().putAll(config.properties()); if (model.contractClass == null) model.contractClass = portClass; if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass; Class<?> seiClass = portClass; metadataReader.getProperties(model.databindingInfo.properties(), portClass); WebService webService = getAnnotation(portClass, WebService.class); if (webService == null) { throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation", portClass.getCanonicalName()); } Class<?> seiFromConfig = configEndpointInterface(); if (webService.endpointInterface().length() > 0 || seiFromConfig != null) { if (seiFromConfig != null) { seiClass = seiFromConfig; } else { seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface())); } model.contractClass = seiClass; model.endpointClass = portClass; WebService seiService = getAnnotation(seiClass, WebService.class); if (seiService == null) { throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice", webService.endpointInterface()); } //check if @SOAPBinding is defined on the impl class SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class); SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class); if(sbPortClass != null){ if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){ logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName())); } } } if (serviceName == null) serviceName = getServiceName(portClass, metadataReader); model.setServiceQName(serviceName); // String portLocalName = portClass.getSimpleName()+PORT; // if (webService.portName().length() >0) { // portLocalName = webService.portName(); // } else if (webService.name().length() >0) { // portLocalName = webService.name()+PORT; // } // // if (portName == null) // portName = new QName(serviceName.getNamespaceURI(), portLocalName); // if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) { // throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch", // serviceName, portName); // } if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI()); model.setPortName(portName); // Check if databinding is overridden in annotation. com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class); if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value()); processClass(seiClass); if (model.getJavaMethods().size() == 0) throw new RuntimeModelerException("runtime.modeler.no.operations", portClass.getName()); model.postProcess(); // Make the configured databinding mode available to the // DatabindingConfig. config.properties().put(BindingContext.class.getName(), model.bindingContext); // TODO: this needs to be fixed properly -- // when we are building RuntimeModel first before building WSDLModel, // we still need to do this correctly if(binding!=null) model.freeze(binding); return model; }
Example 8
Source File: RuntimeModeler.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>. * @return the runtime model for the <code>portClass</code>. */ public AbstractSEIModelImpl buildRuntimeModel() { model = new SOAPSEIModel(features); model.contractClass = config.getContractClass(); model.endpointClass = config.getEndpointClass(); model.classLoader = this.classLoader; model.wsBinding = wsBinding; model.databindingInfo.setWsdlURL(config.getWsdlURL()); model.databindingInfo.properties().putAll(config.properties()); if (model.contractClass == null) model.contractClass = portClass; if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass; Class<?> seiClass = portClass; metadataReader.getProperties(model.databindingInfo.properties(), portClass); WebService webService = getAnnotation(portClass, WebService.class); if (webService == null) { throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation", portClass.getCanonicalName()); } Class<?> seiFromConfig = configEndpointInterface(); if (webService.endpointInterface().length() > 0 || seiFromConfig != null) { if (seiFromConfig != null) { seiClass = seiFromConfig; } else { seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface())); } model.contractClass = seiClass; model.endpointClass = portClass; WebService seiService = getAnnotation(seiClass, WebService.class); if (seiService == null) { throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice", webService.endpointInterface()); } //check if @SOAPBinding is defined on the impl class SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class); SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class); if(sbPortClass != null){ if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){ logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName())); } } } if (serviceName == null) serviceName = getServiceName(portClass, metadataReader); model.setServiceQName(serviceName); // String portLocalName = portClass.getSimpleName()+PORT; // if (webService.portName().length() >0) { // portLocalName = webService.portName(); // } else if (webService.name().length() >0) { // portLocalName = webService.name()+PORT; // } // // if (portName == null) // portName = new QName(serviceName.getNamespaceURI(), portLocalName); // if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) { // throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch", // serviceName, portName); // } if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI()); model.setPortName(portName); // Check if databinding is overridden in annotation. com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class); if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value()); processClass(seiClass); if (model.getJavaMethods().size() == 0) throw new RuntimeModelerException("runtime.modeler.no.operations", portClass.getName()); model.postProcess(); // Make the configured databinding mode available to the // DatabindingConfig. config.properties().put(BindingContext.class.getName(), model.bindingContext); // TODO: this needs to be fixed properly -- // when we are building RuntimeModel first before building WSDLModel, // we still need to do this correctly if(binding!=null) model.freeze(binding); return model; }