com.sun.xml.internal.ws.binding.WebServiceFeatureList Java Examples

The following examples show how to use com.sun.xml.internal.ws.binding.WebServiceFeatureList. 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: WSServiceDelegate.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public <T> T getPort(QName portName, Class<T> portInterface, WebServiceFeature... features) {
    if (portName == null || portInterface == null)
        throw new IllegalArgumentException();
    WSDLService tWsdlService = this.wsdlService;
    if (tWsdlService == null) {
        // assigning it to local variable and not setting it back to this.wsdlService intentionally
        // as we don't want to include the service instance with information gathered from sei
        tWsdlService = getWSDLModelfromSEI(portInterface);
        //still null? throw error need wsdl metadata to create a proxy
        if (tWsdlService == null) {
            throw new WebServiceException(ProviderApiMessages.NO_WSDL_NO_PORT(portInterface.getName()));
        }

    }
    WSDLPort portModel = getPortModel(tWsdlService, portName);
    return getPort(portModel.getEPR(), portName, portInterface, new WebServiceFeatureList(features));
}
 
Example #2
Source File: WSServiceDelegate.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected <T> T getPort(WSEndpointReference wsepr, QName portName, Class<T> portInterface,
                      WebServiceFeatureList features) {
    ComponentFeature cf = features.get(ComponentFeature.class);
    if (cf != null && !Target.STUB.equals(cf.getTarget())) {
        throw new IllegalArgumentException();
    }
    ComponentsFeature csf = features.get(ComponentsFeature.class);
    if (csf != null) {
        for (ComponentFeature cfi : csf.getComponentFeatures()) {
            if (!Target.STUB.equals(cfi.getTarget()))
                throw new IllegalArgumentException();
        }
    }
    features.addAll(this.features);

    SEIPortInfo spi = addSEI(portName, portInterface, features);
    return createEndpointIFBaseProxy(wsepr,portName,portInterface,features, spi);
}
 
Example #3
Source File: WSServiceDelegate.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public <T> Dispatch<T> createDispatch(QName portName, Class<T> aClass, Service.Mode mode, WebServiceFeatureList features) {
    WSEndpointReference wsepr = null;
    boolean isAddressingEnabled = false;
    AddressingFeature af = features.get(AddressingFeature.class);
    if (af == null) {
        af = this.features.get(AddressingFeature.class);
    }
    if (af != null && af.isEnabled())
        isAddressingEnabled = true;
    MemberSubmissionAddressingFeature msa = features.get(MemberSubmissionAddressingFeature.class);
    if (msa == null) {
        msa = this.features.get(MemberSubmissionAddressingFeature.class);
    }
    if (msa != null && msa.isEnabled())
        isAddressingEnabled = true;
    if(isAddressingEnabled && wsdlService != null && wsdlService.get(portName) != null) {
        wsepr = wsdlService.get(portName).getEPR();
    }
    return createDispatch(portName, wsepr, aClass, mode, features);
}
 
Example #4
Source File: WSServiceDelegate.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected Dispatch<Object> createDispatch(QName portName, WSEndpointReference wsepr, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeatureList features) {
    PortInfo port = safeGetPort(portName);

    ComponentFeature cf = features.get(ComponentFeature.class);
    if (cf != null && !Target.STUB.equals(cf.getTarget())) {
        throw new IllegalArgumentException();
    }
    ComponentsFeature csf = features.get(ComponentsFeature.class);
    if (csf != null) {
        for (ComponentFeature cfi : csf.getComponentFeatures()) {
            if (!Target.STUB.equals(cfi.getTarget()))
                throw new IllegalArgumentException();
        }
    }
    features.addAll(this.features);

    BindingImpl binding = port.createBinding(features, null, null);
    binding.setMode(mode);
    Dispatch<Object> dispatch = Stubs.createJAXBDispatch(
            port, binding, jaxbContext, mode,wsepr);
     serviceInterceptor.postCreateDispatch((WSBindingProvider)dispatch);
     return dispatch;
}
 
Example #5
Source File: WSServiceDelegate.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Contributes to the construction of {@link WSServiceDelegate} by filling in
 * {@link SEIPortInfo} about a given SEI (linked from the {@link Service}-derived class.)
 */
//todo: valid port in wsdl
private SEIPortInfo addSEI(QName portName, Class portInterface, WebServiceFeatureList features) throws WebServiceException {
    boolean ownModel = useOwnSEIModel(features);
    if (ownModel) {
        // Create a new model and do not cache it
        return createSEIPortInfo(portName, portInterface, features);
    }

    SEIPortInfo spi = seiContext.get(portName);
    if (spi == null) {
        spi = createSEIPortInfo(portName, portInterface, features);
        seiContext.put(spi.portName, spi);
        ports.put(spi.portName, spi);
    }
    return spi;
}
 
Example #6
Source File: WSServiceDelegate.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Contributes to the construction of {@link WSServiceDelegate} by filling in
 * {@link SEIPortInfo} about a given SEI (linked from the {@link Service}-derived class.)
 */
//todo: valid port in wsdl
private SEIPortInfo addSEI(QName portName, Class portInterface, WebServiceFeatureList features) throws WebServiceException {
    boolean ownModel = useOwnSEIModel(features);
    if (ownModel) {
        // Create a new model and do not cache it
        return createSEIPortInfo(portName, portInterface, features);
    }

    SEIPortInfo spi = seiContext.get(portName);
    if (spi == null) {
        spi = createSEIPortInfo(portName, portInterface, features);
        seiContext.put(spi.portName, spi);
        ports.put(spi.portName, spi);
    }
    return spi;
}
 
Example #7
Source File: WSServiceDelegate.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public <T> Dispatch<T> createDispatch(QName portName, Class<T> aClass, Service.Mode mode, WebServiceFeatureList features) {
    WSEndpointReference wsepr = null;
    boolean isAddressingEnabled = false;
    AddressingFeature af = features.get(AddressingFeature.class);
    if (af == null) {
        af = this.features.get(AddressingFeature.class);
    }
    if (af != null && af.isEnabled())
        isAddressingEnabled = true;
    MemberSubmissionAddressingFeature msa = features.get(MemberSubmissionAddressingFeature.class);
    if (msa == null) {
        msa = this.features.get(MemberSubmissionAddressingFeature.class);
    }
    if (msa != null && msa.isEnabled())
        isAddressingEnabled = true;
    if(isAddressingEnabled && wsdlService != null && wsdlService.get(portName) != null) {
        wsepr = wsdlService.get(portName).getEPR();
    }
    return createDispatch(portName, wsepr, aClass, mode, features);
}
 
Example #8
Source File: WSServiceDelegate.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected <T> T getPort(WSEndpointReference wsepr, QName portName, Class<T> portInterface,
                      WebServiceFeatureList features) {
    ComponentFeature cf = features.get(ComponentFeature.class);
    if (cf != null && !Target.STUB.equals(cf.getTarget())) {
        throw new IllegalArgumentException();
    }
    ComponentsFeature csf = features.get(ComponentsFeature.class);
    if (csf != null) {
        for (ComponentFeature cfi : csf.getComponentFeatures()) {
            if (!Target.STUB.equals(cfi.getTarget()))
                throw new IllegalArgumentException();
        }
    }
    features.addAll(this.features);

    SEIPortInfo spi = addSEI(portName, portInterface, features);
    return createEndpointIFBaseProxy(wsepr,portName,portInterface,features, spi);
}
 
Example #9
Source File: WSServiceDelegate.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public <T> Dispatch<T> createDispatch(QName portName, Class<T> aClass, Service.Mode mode, WebServiceFeatureList features) {
    WSEndpointReference wsepr = null;
    boolean isAddressingEnabled = false;
    AddressingFeature af = features.get(AddressingFeature.class);
    if (af == null) {
        af = this.features.get(AddressingFeature.class);
    }
    if (af != null && af.isEnabled())
        isAddressingEnabled = true;
    MemberSubmissionAddressingFeature msa = features.get(MemberSubmissionAddressingFeature.class);
    if (msa == null) {
        msa = this.features.get(MemberSubmissionAddressingFeature.class);
    }
    if (msa != null && msa.isEnabled())
        isAddressingEnabled = true;
    if(isAddressingEnabled && wsdlService != null && wsdlService.get(portName) != null) {
        wsepr = wsdlService.get(portName).getEPR();
    }
    return createDispatch(portName, wsepr, aClass, mode, features);
}
 
Example #10
Source File: WSServiceDelegate.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public <T> T getPort(QName portName, Class<T> portInterface, WebServiceFeature... features) {
    if (portName == null || portInterface == null)
        throw new IllegalArgumentException();
    WSDLService tWsdlService = this.wsdlService;
    if (tWsdlService == null) {
        // assigning it to local variable and not setting it back to this.wsdlService intentionally
        // as we don't want to include the service instance with information gathered from sei
        tWsdlService = getWSDLModelfromSEI(portInterface);
        //still null? throw error need wsdl metadata to create a proxy
        if (tWsdlService == null) {
            throw new WebServiceException(ProviderApiMessages.NO_WSDL_NO_PORT(portInterface.getName()));
        }

    }
    WSDLPort portModel = getPortModel(tWsdlService, portName);
    return getPort(portModel.getEPR(), portName, portInterface, new WebServiceFeatureList(features));
}
 
Example #11
Source File: WSServiceDelegate.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public SEIModel buildRuntimeModel(QName serviceName, QName portName, Class portInterface, WSDLPort wsdlPort, WebServiceFeatureList features) {
            DatabindingFactory fac = DatabindingFactory.newInstance();
            DatabindingConfig config = new DatabindingConfig();
            config.setContractClass(portInterface);
            config.getMappingInfo().setServiceName(serviceName);
            config.setWsdlPort(wsdlPort);
            config.setFeatures(features);
            config.setClassLoader(portInterface.getClassLoader());
            config.getMappingInfo().setPortName(portName);
            config.setWsdlURL(wsdlURL);
    // if ExternalMetadataFeature present, ExternalMetadataReader will be created ...
    config.setMetadataReader(getMetadadaReader(features, portInterface.getClassLoader()));

            com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);

            return rt.getModel();
}
 
Example #12
Source File: WSServiceDelegate.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public <T> T getPort(Class<T> portInterface, WebServiceFeature... features) {
    //get the portType from SEI
    QName portTypeName = RuntimeModeler.getPortTypeName(portInterface, getMetadadaReader(new WebServiceFeatureList(features), portInterface.getClassLoader()));
    WSDLService tmpWsdlService = this.wsdlService;
    if (tmpWsdlService == null) {
        // assigning it to local variable and not setting it back to this.wsdlService intentionally
        // as we don't want to include the service instance with information gathered from sei
        tmpWsdlService = getWSDLModelfromSEI(portInterface);
        //still null? throw error need wsdl metadata to create a proxy
        if(tmpWsdlService == null) {
            throw new WebServiceException(ProviderApiMessages.NO_WSDL_NO_PORT(portInterface.getName()));
        }
    }
    //get the first port corresponding to the SEI
    WSDLPort port = tmpWsdlService.getMatchingPort(portTypeName);
    if (port == null) {
        throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName));
    }
    QName portName = port.getName();
    return getPort(portName, portInterface,features);
}
 
Example #13
Source File: WSServiceDelegate.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public <T> Dispatch<T> createDispatch(QName portName, WSEndpointReference wsepr, Class<T> aClass, Service.Mode mode, WebServiceFeatureList features) {
    PortInfo port = safeGetPort(portName);

    ComponentFeature cf = features.get(ComponentFeature.class);
    if (cf != null && !Target.STUB.equals(cf.getTarget())) {
        throw new IllegalArgumentException();
    }
    ComponentsFeature csf = features.get(ComponentsFeature.class);
    if (csf != null) {
        for (ComponentFeature cfi : csf.getComponentFeatures()) {
            if (!Target.STUB.equals(cfi.getTarget()))
                throw new IllegalArgumentException();
        }
    }
    features.addAll(this.features);

    BindingImpl binding = port.createBinding(features, null, null);
    binding.setMode(mode);
    Dispatch<T> dispatch = Stubs.createDispatch(port, this, binding, aClass, mode, wsepr);
    serviceInterceptor.postCreateDispatch((WSBindingProvider) dispatch);
    return dispatch;
}
 
Example #14
Source File: WSServiceDelegate.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
protected Dispatch<Object> createDispatch(QName portName, WSEndpointReference wsepr, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeatureList features) {
    PortInfo port = safeGetPort(portName);

    ComponentFeature cf = features.get(ComponentFeature.class);
    if (cf != null && !Target.STUB.equals(cf.getTarget())) {
        throw new IllegalArgumentException();
    }
    ComponentsFeature csf = features.get(ComponentsFeature.class);
    if (csf != null) {
        for (ComponentFeature cfi : csf.getComponentFeatures()) {
            if (!Target.STUB.equals(cfi.getTarget()))
                throw new IllegalArgumentException();
        }
    }
    features.addAll(this.features);

    BindingImpl binding = port.createBinding(features, null, null);
    binding.setMode(mode);
    Dispatch<Object> dispatch = Stubs.createJAXBDispatch(
            port, binding, jaxbContext, mode,wsepr);
     serviceInterceptor.postCreateDispatch((WSBindingProvider)dispatch);
     return dispatch;
}
 
Example #15
Source File: WSServiceDelegate.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public <T> T getPort(QName portName, Class<T> portInterface, WebServiceFeature... features) {
    if (portName == null || portInterface == null)
        throw new IllegalArgumentException();
    WSDLService tWsdlService = this.wsdlService;
    if (tWsdlService == null) {
        // assigning it to local variable and not setting it back to this.wsdlService intentionally
        // as we don't want to include the service instance with information gathered from sei
        tWsdlService = getWSDLModelfromSEI(portInterface);
        //still null? throw error need wsdl metadata to create a proxy
        if (tWsdlService == null) {
            throw new WebServiceException(ProviderApiMessages.NO_WSDL_NO_PORT(portInterface.getName()));
        }

    }
    WSDLPort portModel = getPortModel(tWsdlService, portName);
    return getPort(portModel.getEPR(), portName, portInterface, new WebServiceFeatureList(features));
}
 
Example #16
Source File: WSServiceDelegate.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private <T> T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr, QName portName, Class<T> portInterface,
                                        WebServiceFeatureList webServiceFeatures, SEIPortInfo eif) {
    //fail if service doesnt have WSDL
    if (wsdlService == null) {
        throw new WebServiceException(ClientMessages.INVALID_SERVICE_NO_WSDL(serviceName));
    }

    if (wsdlService.get(portName)==null) {
        throw new WebServiceException(
            ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
    }

    BindingImpl binding = eif.createBinding(webServiceFeatures, portInterface);
    InvocationHandler pis = getStubHandler(binding, eif, epr);

    T proxy = createProxy(portInterface, pis);

    if (serviceInterceptor != null) {
        serviceInterceptor.postCreateProxy((WSBindingProvider)proxy, portInterface);
    }
    return proxy;
}
 
Example #17
Source File: WSServiceDelegate.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public SEIModel buildRuntimeModel(QName serviceName, QName portName, Class portInterface, WSDLPort wsdlPort, WebServiceFeatureList features) {
            DatabindingFactory fac = DatabindingFactory.newInstance();
            DatabindingConfig config = new DatabindingConfig();
            config.setContractClass(portInterface);
            config.getMappingInfo().setServiceName(serviceName);
            config.setWsdlPort(wsdlPort);
            config.setFeatures(features);
            config.setClassLoader(portInterface.getClassLoader());
            config.getMappingInfo().setPortName(portName);
            config.setWsdlURL(wsdlURL);
    // if ExternalMetadataFeature present, ExternalMetadataReader will be created ...
    config.setMetadataReader(getMetadadaReader(features, portInterface.getClassLoader()));

            com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);

            return rt.getModel();
}
 
Example #18
Source File: WSServiceDelegate.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Contributes to the construction of {@link WSServiceDelegate} by filling in
 * {@link SEIPortInfo} about a given SEI (linked from the {@link Service}-derived class.)
 */
//todo: valid port in wsdl
private SEIPortInfo addSEI(QName portName, Class portInterface, WebServiceFeatureList features) throws WebServiceException {
    boolean ownModel = useOwnSEIModel(features);
    if (ownModel) {
        // Create a new model and do not cache it
        return createSEIPortInfo(portName, portInterface, features);
    }

    SEIPortInfo spi = seiContext.get(portName);
    if (spi == null) {
        spi = createSEIPortInfo(portName, portInterface, features);
        seiContext.put(spi.portName, spi);
        ports.put(spi.portName, spi);
    }
    return spi;
}
 
Example #19
Source File: WSServiceDelegate.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected Dispatch<Object> createDispatch(QName portName, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeatureList features) {
    WSEndpointReference wsepr = null;
    boolean isAddressingEnabled = false;
    AddressingFeature af = features.get(AddressingFeature.class);
    if (af == null) {
        af = this.features.get(AddressingFeature.class);
    }
    if (af != null && af.isEnabled())
        isAddressingEnabled = true;
    MemberSubmissionAddressingFeature msa = features.get(MemberSubmissionAddressingFeature.class);
    if (msa == null) {
        msa = this.features.get(MemberSubmissionAddressingFeature.class);
    }
    if (msa != null && msa.isEnabled())
        isAddressingEnabled = true;
    if(isAddressingEnabled && wsdlService != null && wsdlService.get(portName) != null) {
        wsepr = wsdlService.get(portName).getEPR();
    }
    return createDispatch(portName, wsepr, jaxbContext, mode, features);
}
 
Example #20
Source File: WSServiceDelegate.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
protected <T> T getPort(WSEndpointReference wsepr, QName portName, Class<T> portInterface,
                      WebServiceFeatureList features) {
    ComponentFeature cf = features.get(ComponentFeature.class);
    if (cf != null && !Target.STUB.equals(cf.getTarget())) {
        throw new IllegalArgumentException();
    }
    ComponentsFeature csf = features.get(ComponentsFeature.class);
    if (csf != null) {
        for (ComponentFeature cfi : csf.getComponentFeatures()) {
            if (!Target.STUB.equals(cfi.getTarget()))
                throw new IllegalArgumentException();
        }
    }
    features.addAll(this.features);

    SEIPortInfo spi = addSEI(portName, portInterface, features);
    return createEndpointIFBaseProxy(wsepr,portName,portInterface,features, spi);
}
 
Example #21
Source File: WSServiceDelegate.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private <T> T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr, QName portName, Class<T> portInterface,
                                        WebServiceFeatureList webServiceFeatures, SEIPortInfo eif) {
    //fail if service doesnt have WSDL
    if (wsdlService == null) {
        throw new WebServiceException(ClientMessages.INVALID_SERVICE_NO_WSDL(serviceName));
    }

    if (wsdlService.get(portName)==null) {
        throw new WebServiceException(
            ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
    }

    BindingImpl binding = eif.createBinding(webServiceFeatures, portInterface);
    InvocationHandler pis = getStubHandler(binding, eif, epr);

    T proxy = createProxy(portInterface, pis);

    if (serviceInterceptor != null) {
        serviceInterceptor.postCreateProxy((WSBindingProvider)proxy, portInterface);
    }
    return proxy;
}
 
Example #22
Source File: WSServiceDelegate.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public <T> T getPort(WSEndpointReference wsepr, Class<T> portInterface, WebServiceFeature... features) {
    //get the portType from SEI, so that it can be used if EPR does n't have endpointName
    WebServiceFeatureList featureList = new WebServiceFeatureList(features);
    QName portTypeName = RuntimeModeler.getPortTypeName(portInterface, getMetadadaReader(featureList, portInterface.getClassLoader()));
    //if port name is not specified in EPR, it will use portTypeName to get it from the WSDL model.
    QName portName = getPortNameFromEPR(wsepr, portTypeName);
    return getPort(wsepr,portName,portInterface, featureList);
}
 
Example #23
Source File: BindingID.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public WebServiceFeatureList createBuiltinFeatureList() {
    WebServiceFeatureList r=super.createBuiltinFeatureList();
    Boolean mtom = isMTOMEnabled();
    if(mtom != null)
        r.add(new MTOMFeature(mtom));
    return r;
}
 
Example #24
Source File: PortInfo.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public BindingImpl createBinding(WebServiceFeatureList webServiceFeatures, Class<?> portInterface,
            BindingImpl existingBinding) {
            if (existingBinding != null) {
                    webServiceFeatures.addAll(existingBinding.getFeatures());
            }

    Iterable<WebServiceFeature> configFeatures;
    //TODO incase of Dispatch, provide a way to User for complete control of the message processing by giving
    // ability to turn off the WSDL/Policy based features and its associated tubes.

    //Even in case of Dispatch, merge all features configured via WSDL/Policy or deployment configuration
    if (portModel != null) {
        // could have merged features from this.policyMap, but some features are set in WSDLModel which are not there in PolicyMap
        // for ex: <wsaw:UsingAddressing> wsdl extn., and since the policyMap features are merged into WSDLModel anyway during postFinished(),
        // So, using here WsdlModel for merging is right.

        // merge features from WSDL
        configFeatures = portModel.getFeatures();
    } else {
        configFeatures = PolicyUtil.getPortScopedFeatures(policyMap, owner.getServiceName(),portName);
    }
    webServiceFeatures.mergeFeatures(configFeatures, false);

    // merge features from interceptor
    webServiceFeatures.mergeFeatures(owner.serviceInterceptor.preCreateBinding(this, portInterface, webServiceFeatures), false);

    BindingImpl bindingImpl = BindingImpl.create(bindingId, webServiceFeatures.toArray());
    owner.getHandlerConfigurator().configureHandlers(this,bindingImpl);
    return bindingImpl;
}
 
Example #25
Source File: WSServiceDelegate.java    From TencentKona-8 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 #26
Source File: WSServiceDelegate.java    From openjdk-8-source 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 #27
Source File: WSServiceDelegate.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public <T> T getPort(WSEndpointReference wsepr, Class<T> portInterface, WebServiceFeature... features) {
    //get the portType from SEI, so that it can be used if EPR does n't have endpointName
    WebServiceFeatureList featureList = new WebServiceFeatureList(features);
    QName portTypeName = RuntimeModeler.getPortTypeName(portInterface, getMetadadaReader(featureList, portInterface.getClassLoader()));
    //if port name is not specified in EPR, it will use portTypeName to get it from the WSDL model.
    QName portName = getPortNameFromEPR(wsepr, portTypeName);
    return getPort(wsepr,portName,portInterface, featureList);
}
 
Example #28
Source File: BindingID.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public WebServiceFeatureList createBuiltinFeatureList() {
    WebServiceFeatureList r=super.createBuiltinFeatureList();
    Boolean mtom = isMTOMEnabled();
    if(mtom != null)
        r.add(new MTOMFeature(mtom));
    return r;
}
 
Example #29
Source File: WSServiceDelegate.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public <T> Dispatch<T> createDispatch(QName portName, Class<T> aClass, Service.Mode mode, WebServiceFeature... features) {
    return createDispatch(portName, aClass, mode, new WebServiceFeatureList(features));
}
 
Example #30
Source File: RuntimeModeler.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
   *
   * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
   * @param portClass The SEI class to be modeled.
   * @param serviceName The ServiceName to use instead of one calculated from the implementation class
   * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
   * @param features web service features
   */
/*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
      this(portClass, serviceName, wsdlPort, wsdlPort.getBinding().getBindingId(), features);
  }*/

/*private RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, WSDLPortImpl binding, BindingID bindingId, @NotNull WebServiceFeature... features) {
      this.portClass = portClass;
      this.serviceName = serviceName;
      this.binding = binding;
      this.bindingId = bindingId;
      this.features = features;
  }*/

  public RuntimeModeler(@NotNull DatabindingConfig config){
      this.portClass = (config.getEndpointClass() != null)? config.getEndpointClass() : config.getContractClass();
      this.serviceName = config.getMappingInfo().getServiceName();
      this.binding = config.getWsdlPort();
      this.classLoader = config.getClassLoader();
      this.portName = config.getMappingInfo().getPortName();
      this.config = config;
      this.wsBinding = config.getWSBinding();
      metadataReader = config.getMetadataReader();
      targetNamespace = config.getMappingInfo().getTargetNamespace();
      if (metadataReader == null) metadataReader = new ReflectAnnotationReader();
      if (wsBinding != null) {
          this.bindingId = wsBinding.getBindingId();
              if (config.getFeatures() != null) wsBinding.getFeatures().mergeFeatures(config.getFeatures(), false);
              if (binding != null) wsBinding.getFeatures().mergeFeatures(binding.getFeatures(), false);
              this.features = WebServiceFeatureList.toList(wsBinding.getFeatures());
      } else {
          this.bindingId = config.getMappingInfo().getBindingID();
          this.features = WebServiceFeatureList.toList(config.getFeatures());
          if (binding != null) bindingId = binding.getBinding().getBindingId();
          if (bindingId == null) bindingId = getDefaultBindingID();
          if (!features.contains(MTOMFeature.class)) {
              MTOM mtomAn = getAnnotation(portClass, MTOM.class);
              if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn));
          }
          if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) {
              com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class);
              if (es != null) features.add(WebServiceFeatureList.getFeature(es));
          }
          this.wsBinding = bindingId.createBinding(features);
      }
  }