Search in sources :

Example 16 with DatabindingConfig

use of com.sun.xml.ws.api.databinding.DatabindingConfig 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 17 with DatabindingConfig

use of com.sun.xml.ws.api.databinding.DatabindingConfig in project metro-jax-ws by eclipse-ee4j.

the class SDOHRAppServiceTest method testSDO_HRAppService.

public void testSDO_HRAppService() throws Exception {
    Set<SchemaInfo> schemas = SDOUtils.getSchemas(getResource("wsdl/HRAppService.wsdl").getFile());
    DatabindingConfig srvConfig = new DatabindingConfig();
    Class<HRAppService> sei = HRAppService.class;
    Class<HRAppServiceImpl> seb = HRAppServiceImpl.class;
    SDOConfig cSdo = sdoConfig(schemas, false);
    SDOConfig sSdo = sdoConfig(schemas, true);
    srvConfig.setContractClass(sei);
    srvConfig.setEndpointClass(seb);
    DatabindingModeFeature dbm = new DatabindingModeFeature("eclipselink.sdo");
    WebServiceFeature[] features = { dbm };
    srvConfig.setFeatures(features);
    srvConfig.properties().put(SDOContextWrapper.SDO_SCHEMA_INFO, schemas);
    // srvConfig.properties().put(SDOContextWrapper.SDO_SCHEMA_FILE, f);
    srvConfig.properties().put(SDOContextWrapper.SDO_HELPER_CONTEXT_RESOLVER, sSdo.resolver);
    srvConfig.properties().put("com.sun.xml.ws.api.model.SuppressDocLitWrapperGeneration", true);
    DatabindingConfig cliConfig = new DatabindingConfig();
    cliConfig.setContractClass(sei);
    cliConfig.setFeatures(features);
    cliConfig.properties().put(SDOContextWrapper.SDO_SCHEMA_INFO, schemas);
    // cliConfig.properties().put(SDOContextWrapper.SDO_SCHEMA_FILE, f);
    cliConfig.properties().put(SDOContextWrapper.SDO_HELPER_CONTEXT_RESOLVER, cSdo.resolver);
    cliConfig.properties().put("com.sun.xml.ws.api.model.SuppressDocLitWrapperGeneration", true);
    HRAppService proxy = createProxy(sei, srvConfig, cliConfig, debug);
    doTest(proxy, cSdo.context);
}
Also used : DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) SchemaInfo(com.sun.xml.ws.db.sdo.SchemaInfo)

Example 18 with DatabindingConfig

use of com.sun.xml.ws.api.databinding.DatabindingConfig in project metro-jax-ws by eclipse-ee4j.

the class SDOHRAppServiceTest method testSDO_HRAppServiceNoWrapperBug.

// Bug 14071356
public void testSDO_HRAppServiceNoWrapperBug() throws Exception {
    Set<SchemaInfo> schemas = SDOUtils.getSchemas(getResource("wsdl/HRAppServiceBug.wsdl").getFile());
    DatabindingConfig srvConfig = new DatabindingConfig();
    Class<HRAppServiceNoWrapperBug> sei = HRAppServiceNoWrapperBug.class;
    Class<HRAppServiceImpl> seb = HRAppServiceImpl.class;
    SDOConfig cSdo = sdoConfig(schemas, false);
    SDOConfig sSdo = sdoConfig(schemas, true);
    srvConfig.setContractClass(sei);
    srvConfig.setEndpointClass(seb);
    DatabindingModeFeature dbm = new DatabindingModeFeature("eclipselink.sdo");
    WebServiceFeature[] features = { dbm };
    srvConfig.setFeatures(features);
    srvConfig.properties().put(SDOContextWrapper.SDO_SCHEMA_INFO, schemas);
    // srvConfig.properties().put(SDOContextWrapper.SDO_SCHEMA_FILE, f);
    srvConfig.properties().put(SDOContextWrapper.SDO_HELPER_CONTEXT_RESOLVER, sSdo.resolver);
    srvConfig.properties().put("com.sun.xml.ws.api.model.SuppressDocLitWrapperGeneration", true);
    DatabindingConfig cliConfig = new DatabindingConfig();
    cliConfig.setContractClass(sei);
    cliConfig.setFeatures(features);
    cliConfig.properties().put(SDOContextWrapper.SDO_SCHEMA_INFO, schemas);
    // cliConfig.properties().put(SDOContextWrapper.SDO_SCHEMA_FILE, f);
    cliConfig.properties().put(SDOContextWrapper.SDO_HELPER_CONTEXT_RESOLVER, cSdo.resolver);
    cliConfig.properties().put("com.sun.xml.ws.api.model.SuppressDocLitWrapperGeneration", true);
    HRAppServiceNoWrapperBug proxy = createProxy(sei, srvConfig, cliConfig, true);
    java.math.BigDecimal totalComp = proxy.getTotalComp(new BigInteger("222"));
    assertEquals("222", totalComp.toString());
    totalComp = proxy.getTotalComp(new BigInteger("333"));
    assertEquals("333", totalComp.toString());
}
Also used : DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) BigDecimal(java.math.BigDecimal) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) BigInteger(java.math.BigInteger) SchemaInfo(com.sun.xml.ws.db.sdo.SchemaInfo)

Example 19 with DatabindingConfig

use of com.sun.xml.ws.api.databinding.DatabindingConfig in project metro-jax-ws by eclipse-ee4j.

the class BasicDatabindingTestBase method testGlobalElementParamXmlBeansTopdown.

/**
 * Test topdown xbean TypedXmlBeansDOC
 */
public void testGlobalElementParamXmlBeansTopdown() throws Exception {
    Class endpointClass = TypedXmlBeansDOCImpl.class;
    Class proxySEIClass = TypedXmlBeansDOC.class;
    DatabindingConfig srvConfig = new DatabindingConfig();
    srvConfig.setEndpointClass(endpointClass);
    DatabindingModeFeature dbf = databindingMode();
    dbf.getProperties().put("com.sun.xml.ws.api.model.DocWrappeeNamespapceQualified", true);
    srvConfig.setMetadataReader(new JWSAnnotationReader());
    WebServiceFeature[] f = { dbf };
    srvConfig.setFeatures(f);
    DatabindingConfig cliConfig = new DatabindingConfig();
    cliConfig.setContractClass(proxySEIClass);
    cliConfig.setFeatures(f);
    cliConfig.setMetadataReader(new JWSAnnotationReader());
    TypedXmlBeansDOC proxy = createProxy(TypedXmlBeansDOC.class, srvConfig, cliConfig, true);
    {
        Holder<Countries> countries = new Holder<Countries>(new Countries());
        countries.value.getCountry().add(countryInfo("1", "banana"));
        countries.value.getCountry().add(countryInfo("2", "apple"));
        countries.value.getCountry().add(countryInfo("3", "peach"));
        proxy.addCountry(countries, countryInfo("x", "foo"));
        assertEquals(4, countries.value.getCountry().size());
    }
    {
        Countries countries = new Countries();
        countries.getCountry().add(countryInfo("1", "banana"));
        countries.getCountry().add(countryInfo("2", "apple"));
        String res = proxy.getCountryName(countries, "hello");
        assertEquals("hello2", res);
    }
}
Also used : DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) Countries(com.sun.xml.ws.test.xbeandoc.Countries) Holder(jakarta.xml.ws.Holder) TypedXmlBeansDOCImpl(com.sun.xml.ws.test.xbeandoc.TypedXmlBeansDOCImpl) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) TypedXmlBeansDOC(com.sun.xml.ws.test.xbeandoc.TypedXmlBeansDOC)

Example 20 with DatabindingConfig

use of com.sun.xml.ws.api.databinding.DatabindingConfig in project metro-jax-ws by eclipse-ee4j.

the class BasicDatabindingTestBase method testWebParamHolder.

public void testWebParamHolder() throws Exception {
    DatabindingModeFeature dbm = databindingMode();
    WebServiceFeature[] f = { dbm };
    DatabindingConfig cliConfig = new DatabindingConfig();
    cliConfig.setEndpointClass(WebParamHolderSEB.class);
    cliConfig.setFeatures(f);
    Databinding db = (Databinding) factory.createRuntime(cliConfig);
    assertNotNull(db);
}
Also used : DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) Databinding(com.sun.xml.ws.api.databinding.Databinding)

Aggregations

DatabindingConfig (com.sun.xml.ws.api.databinding.DatabindingConfig)22 WebServiceFeature (jakarta.xml.ws.WebServiceFeature)19 DatabindingModeFeature (com.oracle.webservices.api.databinding.DatabindingModeFeature)15 SchemaInfo (com.sun.xml.ws.db.sdo.SchemaInfo)6 Map (java.util.Map)6 QName (javax.xml.namespace.QName)6 WebServiceFeatureList (com.sun.xml.ws.binding.WebServiceFeatureList)4 BindingContext (com.sun.xml.ws.spi.db.BindingContext)4 HelperContext (commonj.sdo.helper.HelperContext)4 File (java.io.File)4 HashMap (java.util.HashMap)4 SDOHelperContext (org.eclipse.persistence.sdo.helper.SDOHelperContext)4 Databinding (com.sun.xml.ws.api.databinding.Databinding)3 DatabindingFactory (com.sun.xml.ws.api.databinding.DatabindingFactory)3 WSDLPort (com.sun.xml.ws.api.model.wsdl.WSDLPort)3 DummyAnnotations (com.sun.xml.ws.base.DummyAnnotations)3 HelperContextResolver (com.sun.xml.ws.db.sdo.HelperContextResolver)3 HelloImpl (com.sun.xml.ws.test.HelloImpl)3 HelloPort (com.sun.xml.ws.test.HelloPort)3 CommandMap (jakarta.activation.CommandMap)3