use of org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean in project jbossws-cxf by jbossws.
the class BeanCustomizer method configureEndpointFactory.
/**
* Configure the endpoint factory
*
* @param factory
*/
protected void configureEndpointFactory(AbstractWSDLBasedEndpointFactory factory) {
// Configure binding customization
if (customization != null) {
ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
// customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
serviceFactory.reset();
DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
configureBindingCustomization(serviceFactoryDataBinding, customization);
serviceFactory.setDataBinding(serviceFactoryDataBinding);
// customize user provided databinding (CXF later overrides the ServiceFactory databinding using the user provided one)
if (factory.getDataBinding() == null) {
// set the endpoint factory's databinding to prevent CXF resetting everything because user did not provide anything
factory.setDataBinding(serviceFactoryDataBinding);
} else {
configureBindingCustomization(factory.getDataBinding(), customization);
}
}
// add other configurations here below
}
use of org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean in project cxf by apache.
the class ClientServiceConfigTest method ordinaryParamNameTest.
@Test
public void ordinaryParamNameTest() throws Exception {
ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
ReflectionServiceFactoryBean factory = new ReflectionServiceFactoryBean();
proxyFac.setServiceFactory(factory);
proxyFac.setDataBinding(new AegisDatabinding());
proxyFac.setAddress("local://Echo");
proxyFac.setBus(getBus());
Echo echo = proxyFac.create(Echo.class);
String boing = echo.simpleEcho("reflection");
assertEquals("reflection", boing);
}
use of org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean in project cxf by apache.
the class DOMMappingTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
createService(DocumentService.class, "DocService");
ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
ReflectionServiceFactoryBean factory = new ReflectionServiceFactoryBean();
factory.getServiceConfigurations().add(0, new org.apache.cxf.aegis.databinding.XFireCompatibilityServiceConfiguration());
proxyFac.setServiceFactory(factory);
proxyFac.setDataBinding(new AegisDatabinding());
proxyFac.setAddress("local://DocService");
proxyFac.setBus(getBus());
Object proxyObj = proxyFac.create(IDocumentService.class);
docClient = (IDocumentService) proxyObj;
Client client = ClientProxy.getClient(proxyObj);
ClientImpl clientImpl = (ClientImpl) client;
clientImpl.setSynchronousTimeout(1000000000);
}
use of org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean in project cxf by apache.
the class ReflectionServiceFactoryTest method testDocLiteralPartWithType.
@Test(expected = ServiceConstructionException.class)
public void testDocLiteralPartWithType() throws Exception {
serviceFactory = new ReflectionServiceFactoryBean();
serviceFactory.setBus(getBus());
serviceFactory.setServiceClass(NoBodyPartsImpl.class);
serviceFactory.getServiceConfigurations().add(0, new AbstractServiceConfiguration() {
@Override
public Boolean isWrapped() {
return Boolean.FALSE;
}
@Override
public Boolean isWrapped(Method m) {
return Boolean.FALSE;
}
});
Service service = serviceFactory.create();
ServiceInfo serviceInfo = service.getServiceInfos().get(0);
QName qname = new QName("urn:org:apache:cxf:no_body_parts/wsdl", "operation1");
MessageInfo mi = serviceInfo.getMessage(qname);
qname = new QName("urn:org:apache:cxf:no_body_parts/wsdl", "mimeAttachment");
MessagePartInfo mpi = mi.getMessagePart(qname);
QName elementQName = mpi.getElementQName();
XmlSchemaElement element = serviceInfo.getXmlSchemaCollection().getElementByQName(elementQName);
assertNotNull(element);
}
use of org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean in project cxf by apache.
the class CodeFirstWSDLTest method createService.
private Definition createService(Class<?> clazz) throws Exception {
JaxWsImplementorInfo info = new JaxWsImplementorInfo(clazz);
ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean(info);
Bus bus = getBus();
bean.setBus(bus);
Service service = bean.create();
InterfaceInfo i = service.getServiceInfos().get(0).getInterface();
assertEquals(5, i.getOperations().size());
ServerFactoryBean svrFactory = new ServerFactoryBean();
svrFactory.setBus(bus);
svrFactory.setServiceFactory(bean);
svrFactory.setServiceBean(clazz.newInstance());
svrFactory.setAddress(address);
svrFactory.create();
Collection<BindingInfo> bindings = service.getServiceInfos().get(0).getBindings();
assertEquals(1, bindings.size());
ServiceWSDLBuilder wsdlBuilder = new ServiceWSDLBuilder(bus, service.getServiceInfos().get(0));
return wsdlBuilder.build();
}
Aggregations