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);
}
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);
}
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());
}
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);
}
}
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);
}
Aggregations