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