use of com.oracle.webservices.api.databinding.DatabindingModeFeature 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());
}
use of com.oracle.webservices.api.databinding.DatabindingModeFeature 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.oracle.webservices.api.databinding.DatabindingModeFeature 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.oracle.webservices.api.databinding.DatabindingModeFeature 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.oracle.webservices.api.databinding.DatabindingModeFeature 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