Search in sources :

Example 1 with DatabindingFactory

use of com.oracle.webservices.api.databinding.DatabindingFactory in project metro-jax-ws by eclipse-ee4j.

the class SAAJMessageWrapperTest method setUp.

public void setUp() {
    Class<?> proxySEI = MtomSEI.class;
    DatabindingFactory dbfac = DatabindingFactory.newInstance();
    Databinding.Builder builder = dbfac.createBuilder(proxySEI, null);
    builder.serviceName(new QName("http://example.org", "MtomTestService"));
    builder.portName(new QName("http://example.org", "MtomTestPort"));
    builder.feature(mtomf);
    databinding = builder.build();
    mcf = MessageContextFactory.createFactory(mtomf);
    Method method = findMethod(proxySEI, "echoByteArray");
    byte[] req = reqStr.getBytes();
    Object[] args = { req };
    clientCall = databinding.createJavaCallInfo(method, args);
}
Also used : DatabindingFactory(com.oracle.webservices.api.databinding.DatabindingFactory) QName(javax.xml.namespace.QName) Method(java.lang.reflect.Method) Databinding(com.oracle.webservices.api.databinding.Databinding)

Example 2 with DatabindingFactory

use of com.oracle.webservices.api.databinding.DatabindingFactory in project metro-jax-ws by eclipse-ee4j.

the class JAXBWrapperAccessorTest method testDatabindingCreation.

public void testDatabindingCreation() {
    Class<?> sei = DocServicePortType.class;
    DatabindingFactory fac = DatabindingFactory.newInstance();
    Databinding.Builder b = fac.createBuilder(sei, null);
    DatabindingModeFeature dbf = new DatabindingModeFeature("eclipselink.jaxb");
    WebServiceFeature[] f = { dbf };
    b.feature(f);
    String ns = "http://performance.bea.com";
    b.serviceName(new QName(ns, "DocService"));
    b.portName(new QName(ns, "DocServicePortTypePort"));
    assertNotNull(b.build());
}
Also used : DatabindingFactory(com.oracle.webservices.api.databinding.DatabindingFactory) QName(javax.xml.namespace.QName) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) Databinding(com.oracle.webservices.api.databinding.Databinding)

Example 3 with DatabindingFactory

use of com.oracle.webservices.api.databinding.DatabindingFactory in project metro-jax-ws by eclipse-ee4j.

the class WrapperNSTest method testWrapperNS.

public void testWrapperNS() throws Exception {
    Class<?> sei = MyHelloRPC.class;
    DatabindingFactory fac = DatabindingFactory.newInstance();
    Databinding.Builder b = fac.createBuilder(sei, null);
    DatabindingModeFeature dbf = new DatabindingModeFeature("eclipselink.jaxb");
    WebServiceFeature[] f = { dbf };
    b.feature(f);
    b.serviceName(new QName("http://echo.org/", "helloService"));
    b.portName(new QName("http://echo.org/", "helloPort"));
    Databinding db = b.build();
    {
        Method method = findMethod(sei, "echoString");
        Object[] args = { "test" };
        JavaCallInfo call = db.createJavaCallInfo(method, args);
        MessageContext mc = db.serializeRequest(call);
        SOAPMessage msg = mc.getSOAPMessage();
        // System.out.println("------------------ eclipselink");
        // msg.writeTo(System.out);
        // System.out.println();
        Node n = msg.getSOAPBody().getChildNodes().item(0);
        // System.out.println("num of attributes is: "+
        // n.getAttributes().getLength());
        assertTrue(n.getAttributes().getLength() == 1);
    }
}
Also used : DatabindingFactory(com.oracle.webservices.api.databinding.DatabindingFactory) QName(javax.xml.namespace.QName) Node(org.w3c.dom.Node) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) Method(java.lang.reflect.Method) SOAPMessage(jakarta.xml.soap.SOAPMessage) Databinding(com.oracle.webservices.api.databinding.Databinding) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) JavaCallInfo(com.oracle.webservices.api.databinding.JavaCallInfo) MessageContext(com.oracle.webservices.api.message.MessageContext)

Example 4 with DatabindingFactory

use of com.oracle.webservices.api.databinding.DatabindingFactory in project metro-jax-ws by eclipse-ee4j.

the class WrapperNSTest method testGenerateWsdl.

public void testGenerateWsdl() throws Exception {
    Class<?> sei = MyHelloRPC.class;
    DatabindingFactory fac = DatabindingFactory.newInstance();
    Databinding.Builder b = fac.createBuilder(sei, null);
    DatabindingModeFeature dbf = new DatabindingModeFeature("eclipselink.jaxb");
    WebServiceFeature[] f = { dbf };
    DatabindingConfig config = new DatabindingConfig();
    config.setFeatures(f);
    config.setEndpointClass(MyHelloClass.class);
    MappingInfo mi = new MappingInfo();
    mi.setServiceName(new QName("http://echo.org/", "helloService"));
    mi.setPortName(new QName("http://echo.org/", "helloPort"));
    config.setMappingInfo(mi);
    config.setClassLoader(this.getClass().getClassLoader());
    RuntimeModeler rtModeler = new RuntimeModeler(config);
    rtModeler.buildRuntimeModel();
}
Also used : DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) DatabindingFactory(com.oracle.webservices.api.databinding.DatabindingFactory) QName(javax.xml.namespace.QName) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) RuntimeModeler(com.sun.xml.ws.model.RuntimeModeler) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) Databinding(com.oracle.webservices.api.databinding.Databinding) MappingInfo(com.sun.xml.ws.api.databinding.MappingInfo)

Example 5 with DatabindingFactory

use of com.oracle.webservices.api.databinding.DatabindingFactory in project metro-jax-ws by eclipse-ee4j.

the class WrapperNSTest method testWrapperNS_JAXBRI.

public void testWrapperNS_JAXBRI() throws Exception {
    Class<?> sei = MyHelloRPC.class;
    DatabindingFactory fac = DatabindingFactory.newInstance();
    Databinding.Builder b = fac.createBuilder(sei, null);
    DatabindingModeFeature dbf = new DatabindingModeFeature("glassfish.jaxb");
    WebServiceFeature[] f = { dbf };
    b.feature(f);
    b.serviceName(new QName("http://echo.org/", "helloService"));
    b.portName(new QName("http://echo.org/", "helloPort"));
    Databinding db = b.build();
    {
        Method method = findMethod(sei, "echoString");
        Object[] args = { "test" };
        JavaCallInfo call = db.createJavaCallInfo(method, args);
        MessageContext mc = db.serializeRequest(call);
        SOAPMessage msg = mc.getSOAPMessage();
        // System.out.println("------------------ glassfish");
        // msg.writeTo(System.out);
        // System.out.println();
        Node n = msg.getSOAPBody().getChildNodes().item(0);
        // System.out.println("num of attributes is: "+
        // n.getAttributes().getLength());
        assertTrue(n.getAttributes().getLength() == 1);
    }
}
Also used : DatabindingFactory(com.oracle.webservices.api.databinding.DatabindingFactory) QName(javax.xml.namespace.QName) Node(org.w3c.dom.Node) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) Method(java.lang.reflect.Method) SOAPMessage(jakarta.xml.soap.SOAPMessage) Databinding(com.oracle.webservices.api.databinding.Databinding) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) JavaCallInfo(com.oracle.webservices.api.databinding.JavaCallInfo) MessageContext(com.oracle.webservices.api.message.MessageContext)

Aggregations

Databinding (com.oracle.webservices.api.databinding.Databinding)6 DatabindingFactory (com.oracle.webservices.api.databinding.DatabindingFactory)6 QName (javax.xml.namespace.QName)6 DatabindingModeFeature (com.oracle.webservices.api.databinding.DatabindingModeFeature)4 WebServiceFeature (jakarta.xml.ws.WebServiceFeature)4 MessageContext (com.oracle.webservices.api.message.MessageContext)3 SOAPMessage (jakarta.xml.soap.SOAPMessage)3 Method (java.lang.reflect.Method)3 JavaCallInfo (com.oracle.webservices.api.databinding.JavaCallInfo)2 Node (org.w3c.dom.Node)2 MessageContextFactory (com.oracle.webservices.api.message.MessageContextFactory)1 DatabindingConfig (com.sun.xml.ws.api.databinding.DatabindingConfig)1 MappingInfo (com.sun.xml.ws.api.databinding.MappingInfo)1 RuntimeModeler (com.sun.xml.ws.model.RuntimeModeler)1