Search in sources :

Example 21 with ReflectionServiceFactoryBean

use of org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean in project cxf by apache.

the class JaxWsServiceFactoryBeanTest method testHolder.

@Test
public void testHolder() throws Exception {
    ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
    Bus bus = getBus();
    bean.setBus(bus);
    bean.setServiceClass(TestMtomImpl.class);
    Service service = bean.create();
    InterfaceInfo intf = service.getServiceInfos().get(0).getInterface();
    OperationInfo op = intf.getOperation(new QName("http://cxf.apache.org/mime", "testXop"));
    assertNotNull(op);
    Iterator<MessagePartInfo> itr = op.getInput().getMessageParts().iterator();
    assertTrue(itr.hasNext());
    MessagePartInfo part = itr.next();
    assertEquals("testXop", part.getElementQName().getLocalPart());
    op = op.getUnwrappedOperation();
    assertNotNull(op);
    // test setup of input parts
    itr = op.getInput().getMessageParts().iterator();
    assertTrue(itr.hasNext());
    part = itr.next();
    assertEquals("name", part.getName().getLocalPart());
    assertEquals(String.class, part.getTypeClass());
/*
         * revisit, try to use other wsdl operation rewrite test in future
        assertTrue(itr.hasNext());
        part = itr.next();
        assertEquals(Boolean.TRUE, part.getProperty(JaxWsServiceFactoryBean.MODE_INOUT));
        assertEquals(byte[].class, part.getTypeClass());

        assertFalse(itr.hasNext());

        // test output setup
        itr = op.getOutput().getMessageParts().iterator();

        assertTrue(itr.hasNext());
        part = itr.next();
        assertEquals(Boolean.TRUE, part.getProperty(JaxWsServiceFactoryBean.MODE_INOUT));
        */
}
Also used : OperationInfo(org.apache.cxf.service.model.OperationInfo) Bus(org.apache.cxf.Bus) QName(javax.xml.namespace.QName) Service(org.apache.cxf.service.Service) WebService(javax.jws.WebService) InterfaceInfo(org.apache.cxf.service.model.InterfaceInfo) ReflectionServiceFactoryBean(org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean) MessagePartInfo(org.apache.cxf.service.model.MessagePartInfo) Test(org.junit.Test) AbstractJaxWsTest(org.apache.cxf.jaxws.AbstractJaxWsTest)

Aggregations

ReflectionServiceFactoryBean (org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean)21 Service (org.apache.cxf.service.Service)13 Test (org.junit.Test)11 WebService (javax.jws.WebService)9 Bus (org.apache.cxf.Bus)9 JaxWsServiceFactoryBean (org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean)8 QName (javax.xml.namespace.QName)6 AbstractJaxWsTest (org.apache.cxf.jaxws.AbstractJaxWsTest)6 MessagePartInfo (org.apache.cxf.service.model.MessagePartInfo)6 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)6 ServerFactoryBean (org.apache.cxf.frontend.ServerFactoryBean)5 BeanInvoker (org.apache.cxf.service.invoker.BeanInvoker)5 InterfaceInfo (org.apache.cxf.service.model.InterfaceInfo)5 URL (java.net.URL)4 ServiceWSDLBuilder (org.apache.cxf.wsdl11.ServiceWSDLBuilder)4 GreeterImpl (org.apache.hello_world_soap_http.GreeterImpl)4 AegisDatabinding (org.apache.cxf.aegis.databinding.AegisDatabinding)3 ClientImpl (org.apache.cxf.endpoint.ClientImpl)3 BindingInfo (org.apache.cxf.service.model.BindingInfo)3 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)3