Search in sources :

Example 1 with Countries

use of com.sun.xml.ws.test.xbeandoc.Countries 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)

Aggregations

DatabindingModeFeature (com.oracle.webservices.api.databinding.DatabindingModeFeature)1 DatabindingConfig (com.sun.xml.ws.api.databinding.DatabindingConfig)1 Countries (com.sun.xml.ws.test.xbeandoc.Countries)1 TypedXmlBeansDOC (com.sun.xml.ws.test.xbeandoc.TypedXmlBeansDOC)1 TypedXmlBeansDOCImpl (com.sun.xml.ws.test.xbeandoc.TypedXmlBeansDOCImpl)1 Holder (jakarta.xml.ws.Holder)1 WebServiceFeature (jakarta.xml.ws.WebServiceFeature)1