Search in sources :

Example 6 with WebServiceFeatureList

use of com.sun.xml.ws.binding.WebServiceFeatureList in project metro-jax-ws by eclipse-ee4j.

the class WsDatabindingTestBase method createProxy.

public static <T> T createProxy(Class<T> proxySEI, Class<?> endpointClass, String db, boolean debug) throws Exception {
    DatabindingConfig srvConfig = new DatabindingConfig();
    srvConfig.setEndpointClass(endpointClass);
    DatabindingModeFeature dbf = new DatabindingModeFeature(db);
    WebServiceFeatureList wsfeatures = new WebServiceFeatureList(endpointClass);
    WebServiceFeature[] f = { dbf };
    // config.setFeatures(wsfeatures.toArray());
    srvConfig.setFeatures(f);
    DatabindingConfig cliConfig = new DatabindingConfig();
    cliConfig.setContractClass(proxySEI);
    cliConfig.setFeatures(f);
    return createProxy(proxySEI, srvConfig, cliConfig, debug);
}
Also used : DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) WebServiceFeatureList(com.sun.xml.ws.binding.WebServiceFeatureList)

Example 7 with WebServiceFeatureList

use of com.sun.xml.ws.binding.WebServiceFeatureList in project metro-jax-ws by eclipse-ee4j.

the class WebServiceFeatureFactory method getWSFeatureList.

/**
 * Returns a feature list for feature annotations(i.e which have
 * {@link jakarta.xml.ws.spi.WebServiceFeatureAnnotation} meta annotation)
 *
 * @param ann list of annotations(that can also have non-feature annotations)
 * @return non-null feature list object
 */
public static WSFeatureList getWSFeatureList(Iterable<Annotation> ann) {
    WebServiceFeatureList list = new WebServiceFeatureList();
    list.parseAnnotations(ann);
    return list;
}
Also used : WebServiceFeatureList(com.sun.xml.ws.binding.WebServiceFeatureList)

Example 8 with WebServiceFeatureList

use of com.sun.xml.ws.binding.WebServiceFeatureList in project metro-jax-ws by eclipse-ee4j.

the class DeploymentDescriptorParser method createBinding.

/**
 * @param ddBindingId   binding id explicitlyspecified in the DeploymentDescriptor or parameter
 * @param implClass     Endpoint Implementation class
 * @param mtomEnabled   represents mtom-enabled attribute in DD
 * @param mtomThreshold threshold value specified in DD
 * @return is returned with only MTOMFeature set resolving the various precendece rules
 */
private static WSBinding createBinding(String ddBindingId, Class implClass, String mtomEnabled, String mtomThreshold, String dataBindingMode) {
    // Features specified through DD
    WebServiceFeatureList features;
    MTOMFeature mtomfeature = null;
    if (mtomEnabled != null) {
        if (mtomThreshold != null) {
            mtomfeature = new MTOMFeature(Boolean.valueOf(mtomEnabled), Integer.parseInt(mtomThreshold));
        } else {
            mtomfeature = new MTOMFeature(Boolean.valueOf(mtomEnabled));
        }
    }
    BindingID bindingID;
    if (ddBindingId != null) {
        bindingID = BindingID.parse(ddBindingId);
        features = bindingID.createBuiltinFeatureList();
        if (checkMtomConflict(features.get(MTOMFeature.class), mtomfeature)) {
            throw new ServerRtException(ServerMessages.DD_MTOM_CONFLICT(ddBindingId, mtomEnabled));
        }
    } else {
        bindingID = BindingID.parse(implClass);
        // Since bindingID is coming from implclass,
        // mtom through Feature annotation or DD takes precendece
        features = new WebServiceFeatureList();
        if (mtomfeature != null) {
            // this wins over MTOM setting in bindingID
            features.add(mtomfeature);
        }
        features.addAll(bindingID.createBuiltinFeatureList());
    }
    if (dataBindingMode != null) {
        features.add(new DatabindingModeFeature(dataBindingMode));
    }
    return bindingID.createBinding(features.toArray());
}
Also used : MTOMFeature(jakarta.xml.ws.soap.MTOMFeature) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) WebServiceFeatureList(com.sun.xml.ws.binding.WebServiceFeatureList) BindingID(com.sun.xml.ws.api.BindingID) ServerRtException(com.sun.xml.ws.server.ServerRtException)

Example 9 with WebServiceFeatureList

use of com.sun.xml.ws.binding.WebServiceFeatureList in project metro-jax-ws by eclipse-ee4j.

the class SEIPortInfoTest method testCreateBindingWSFList.

public void testCreateBindingWSFList() throws MalformedURLException {
    SEIPortInfo seiPortInfo = createSEIPortInfo();
    BindingImpl b = seiPortInfo.createBinding(new WebServiceFeatureList(), PORT_INTERFACE);
    boolean understands = ((SOAPBindingImpl) b).understandsHeader(EXTRA_HEADER);
    assertTrue("header " + EXTRA_HEADER + " must be understood", understands);
}
Also used : BindingImpl(com.sun.xml.ws.binding.BindingImpl) SOAPBindingImpl(com.sun.xml.ws.binding.SOAPBindingImpl) SOAPBindingImpl(com.sun.xml.ws.binding.SOAPBindingImpl) WebServiceFeatureList(com.sun.xml.ws.binding.WebServiceFeatureList)

Example 10 with WebServiceFeatureList

use of com.sun.xml.ws.binding.WebServiceFeatureList in project metro-jax-ws by eclipse-ee4j.

the class WebParamTest method testWebParam1.

void testWebParam1(String dbmode) throws Exception {
    DatabindingConfig srvConfig = new DatabindingConfig();
    srvConfig.setEndpointClass(WebParamWebServiceImpl.class);
    srvConfig.getMappingInfo().setDefaultSchemaNamespaceSuffix("types");
    DatabindingModeFeature dbf = new DatabindingModeFeature(dbmode);
    WebServiceFeatureList wsfeatures = new WebServiceFeatureList(WebParamWebServiceImpl.class);
    WebServiceFeature[] f = { dbf };
    srvConfig.setFeatures(f);
    DatabindingConfig cliConfig = new DatabindingConfig();
    cliConfig.setContractClass(WebParamWebService.class);
    cliConfig.setFeatures(f);
    WebParamWebService port = createProxy(WebParamWebService.class, srvConfig, cliConfig, debug);
    {
        jakarta.xml.ws.Holder<Employee> employeeHolder = new jakarta.xml.ws.Holder<Employee>();
        port.helloString4("jsr181", employeeHolder);
        Employee employee = (Employee) employeeHolder.value;
        Name output = employee.getName();
        assertEquals(output.getFirstName(), "jsr181");
        assertEquals(output.getLastName(), "jaxws");
    }
    {
        jakarta.xml.ws.Holder<Employee> employeeHolder = new jakarta.xml.ws.Holder<Employee>();
        Name name = new Name();
        name.setFirstName("jsr181");
        name.setLastName("jsr109");
        port.helloString7("jsr181", name, employeeHolder);
        Employee employee = (Employee) employeeHolder.value;
        Name output = employee.getName();
        assertEquals(output.getFirstName(), "jsr181");
        assertEquals(output.getLastName(), "jsr109");
    }
}
Also used : DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) WebServiceFeatureList(com.sun.xml.ws.binding.WebServiceFeatureList) DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) WebServiceFeature(jakarta.xml.ws.WebServiceFeature)

Aggregations

WebServiceFeatureList (com.sun.xml.ws.binding.WebServiceFeatureList)12 DatabindingModeFeature (com.oracle.webservices.api.databinding.DatabindingModeFeature)4 DatabindingConfig (com.sun.xml.ws.api.databinding.DatabindingConfig)4 WSDLPort (com.sun.xml.ws.api.model.wsdl.WSDLPort)4 WebServiceFeature (jakarta.xml.ws.WebServiceFeature)4 QName (javax.xml.namespace.QName)3 BindingID (com.sun.xml.ws.api.BindingID)2 WSDLService (com.sun.xml.ws.api.model.wsdl.WSDLService)2 BindingImpl (com.sun.xml.ws.binding.BindingImpl)2 SOAPBindingImpl (com.sun.xml.ws.binding.SOAPBindingImpl)2 AbstractSEIModelImpl (com.sun.xml.ws.model.AbstractSEIModelImpl)2 WebServiceException (jakarta.xml.ws.WebServiceException)2 WSDLResolver (com.oracle.webservices.api.databinding.WSDLResolver)1 WebServiceAp (com.sun.tools.ws.processor.modeler.annotation.WebServiceAp)1 DatabindingFactory (com.sun.xml.ws.api.databinding.DatabindingFactory)1 MetadataReader (com.sun.xml.ws.api.databinding.MetadataReader)1 WSDLGenInfo (com.sun.xml.ws.api.databinding.WSDLGenInfo)1 SEIModel (com.sun.xml.ws.api.model.SEIModel)1 SDDocumentSource (com.sun.xml.ws.api.server.SDDocumentSource)1 WSDLGeneratorExtension (com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension)1