Java Code Examples for com.sun.xml.internal.ws.api.BindingID#parse()

The following examples show how to use com.sun.xml.internal.ws.api.BindingID#parse() . 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: WebServiceFeatureList.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example 2
Source File: WebServiceFeatureList.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example 3
Source File: WebServiceFeatureList.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example 4
Source File: WebServiceFeatureList.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example 5
Source File: WSServiceDelegate.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void addPort(QName portName, String bindingId, String endpointAddress) throws WebServiceException {
    if (!ports.containsKey(portName)) {
        BindingID bid = (bindingId == null) ? BindingID.SOAP11_HTTP : BindingID.parse(bindingId);
        ports.put(portName,
                new PortInfo(this, (endpointAddress == null) ? null :
                        EndpointAddress.create(endpointAddress), portName, bid));
    } else
        throw new WebServiceException(DispatchMessages.DUPLICATE_PORT(portName.toString()));
}
 
Example 6
Source File: ProviderImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Endpoint createAndPublishEndpoint(String address,
                                         Object implementor) {
    Endpoint endpoint = new EndpointImpl(
        BindingID.parse(implementor.getClass()),
        implementor);
    endpoint.publish(address);
    return endpoint;
}
 
Example 7
Source File: WsgenOptions.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void validateBinding() throws BadCommandLineException {
    if (genWsdl) {
        BindingID binding = BindingID.parse(endpoint);
        if ((binding.equals(BindingID.SOAP12_HTTP) ||
             binding.equals(BindingID.SOAP12_HTTP_MTOM)) &&
                !(protocol.equals(X_SOAP12) && isExtensionMode())) {
            throw new BadCommandLineException(WscompileMessages.WSGEN_CANNOT_GEN_WSDL_FOR_SOAP_12_BINDING(binding.toString(), endpoint.getName()));
        }
        if (binding.equals(BindingID.XML_HTTP)) {
            throw new BadCommandLineException(WscompileMessages.WSGEN_CANNOT_GEN_WSDL_FOR_NON_SOAP_BINDING(binding.toString(), endpoint.getName()));
        }
    }
}
 
Example 8
Source File: WsgenOptions.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void validateBinding() throws BadCommandLineException {
    if (genWsdl) {
        BindingID binding = BindingID.parse(endpoint);
        if ((binding.equals(BindingID.SOAP12_HTTP) ||
             binding.equals(BindingID.SOAP12_HTTP_MTOM)) &&
                !(protocol.equals(X_SOAP12) && isExtensionMode())) {
            throw new BadCommandLineException(WscompileMessages.WSGEN_CANNOT_GEN_WSDL_FOR_SOAP_12_BINDING(binding.toString(), endpoint.getName()));
        }
        if (binding.equals(BindingID.XML_HTTP)) {
            throw new BadCommandLineException(WscompileMessages.WSGEN_CANNOT_GEN_WSDL_FOR_NON_SOAP_BINDING(binding.toString(), endpoint.getName()));
        }
    }
}
 
Example 9
Source File: WSServiceDelegate.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void addPort(QName portName, String bindingId, String endpointAddress) throws WebServiceException {
    if (!ports.containsKey(portName)) {
        BindingID bid = (bindingId == null) ? BindingID.SOAP11_HTTP : BindingID.parse(bindingId);
        ports.put(portName,
                new PortInfo(this, (endpointAddress == null) ? null :
                        EndpointAddress.create(endpointAddress), portName, bid));
    } else
        throw new WebServiceException(DispatchMessages.DUPLICATE_PORT(portName.toString()));
}
 
Example 10
Source File: RuntimeModeler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private BindingID getDefaultBindingID() {
BindingType bt = getAnnotation(portClass, BindingType.class);
if (bt != null) return BindingID.parse(bt.value());
SOAPVersion ver = getSoapVersion(features);
boolean mtomEnabled = features.isEnabled(MTOMFeature.class);
if (SOAPVersion.SOAP_12.equals(ver)) {
    return (mtomEnabled) ? BindingID.SOAP12_HTTP_MTOM : BindingID.SOAP12_HTTP;
} else {
    return (mtomEnabled) ? BindingID.SOAP11_HTTP_MTOM : BindingID.SOAP11_HTTP;
}
}
 
Example 11
Source File: BindingImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static BindingImpl create(@NotNull BindingID bindingId, WebServiceFeature[] features) {
    // Override the BindingID from the features
    for(WebServiceFeature feature : features) {
        if (feature instanceof BindingTypeFeature) {
            BindingTypeFeature f = (BindingTypeFeature)feature;
            bindingId = BindingID.parse(f.getBindingId());
        }
    }
    if (bindingId.equals(BindingID.XML_HTTP))
        return new HTTPBindingImpl(features);
    else
        return new SOAPBindingImpl(bindingId, features);
}
 
Example 12
Source File: BindingImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static BindingImpl create(@NotNull BindingID bindingId, WebServiceFeature[] features) {
    // Override the BindingID from the features
    for(WebServiceFeature feature : features) {
        if (feature instanceof BindingTypeFeature) {
            BindingTypeFeature f = (BindingTypeFeature)feature;
            bindingId = BindingID.parse(f.getBindingId());
        }
    }
    if (bindingId.equals(BindingID.XML_HTTP))
        return new HTTPBindingImpl(features);
    else
        return new SOAPBindingImpl(bindingId, features);
}
 
Example 13
Source File: RuntimeModeler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private BindingID getDefaultBindingID() {
BindingType bt = getAnnotation(portClass, BindingType.class);
if (bt != null) return BindingID.parse(bt.value());
SOAPVersion ver = getSoapVersion(features);
boolean mtomEnabled = features.isEnabled(MTOMFeature.class);
if (SOAPVersion.SOAP_12.equals(ver)) {
    return (mtomEnabled) ? BindingID.SOAP12_HTTP_MTOM : BindingID.SOAP12_HTTP;
} else {
    return (mtomEnabled) ? BindingID.SOAP11_HTTP_MTOM : BindingID.SOAP11_HTTP;
}
}
 
Example 14
Source File: RuntimeModeler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private BindingID getDefaultBindingID() {
BindingType bt = getAnnotation(portClass, BindingType.class);
if (bt != null) return BindingID.parse(bt.value());
SOAPVersion ver = getSoapVersion(features);
boolean mtomEnabled = features.isEnabled(MTOMFeature.class);
if (SOAPVersion.SOAP_12.equals(ver)) {
    return (mtomEnabled) ? BindingID.SOAP12_HTTP_MTOM : BindingID.SOAP12_HTTP;
} else {
    return (mtomEnabled) ? BindingID.SOAP11_HTTP_MTOM : BindingID.SOAP11_HTTP;
}
}
 
Example 15
Source File: ProviderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Endpoint createEndpoint(String bindingId, Class implementorClass, Invoker invoker, WebServiceFeature... features) {
    return new EndpointImpl(
        (bindingId != null) ? BindingID.parse(bindingId) : BindingID.parse(implementorClass),
        implementorClass, invoker, features);
}
 
Example 16
Source File: ProviderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Endpoint createAndPublishEndpoint(String address, Object implementor, WebServiceFeature... features) {
    Endpoint endpoint = new EndpointImpl(
        BindingID.parse(implementor.getClass()), implementor, features);
    endpoint.publish(address);
    return endpoint;
}
 
Example 17
Source File: ProviderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Endpoint createAndPublishEndpoint(String address, Object implementor, WebServiceFeature... features) {
    Endpoint endpoint = new EndpointImpl(
        BindingID.parse(implementor.getClass()), implementor, features);
    endpoint.publish(address);
    return endpoint;
}
 
Example 18
Source File: ProviderImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Endpoint createEndpoint(String bindingId, Object implementor) {
    return new EndpointImpl(
        (bindingId != null) ? BindingID.parse(bindingId) : BindingID.parse(implementor.getClass()),
        implementor);
}
 
Example 19
Source File: ProviderImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public Endpoint createEndpoint(String bindingId, Class implementorClass, Invoker invoker, WebServiceFeature... features) {
    return new EndpointImpl(
        (bindingId != null) ? BindingID.parse(bindingId) : BindingID.parse(implementorClass),
        implementorClass, invoker, features);
}
 
Example 20
Source File: ProviderImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public Endpoint createAndPublishEndpoint(String address, Object implementor, WebServiceFeature... features) {
    Endpoint endpoint = new EndpointImpl(
        BindingID.parse(implementor.getClass()), implementor, features);
    endpoint.publish(address);
    return endpoint;
}