Search in sources :

Example 1 with LocatorFeature

use of org.talend.esb.servicelocator.cxf.LocatorFeature in project tesb-rt-se by Talend.

the class Client method prepareFactoryBean.

private JAXRSClientFactoryBean prepareFactoryBean() throws Exception {
    JAXRSClientFactoryBean factoryBean = new JAXRSClientFactoryBean();
    factoryBean.setAddress("locator://some_usefull_information");
    factoryBean.setServiceName(new QName("http://common.demo/", "OrderService"));
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "META-INF/tesb/locator/beans.xml" });
    LocatorFeature feature = (LocatorFeature) context.getBean("locatorFeature");
    factoryBean.setFeatures(Collections.singletonList(feature));
    return factoryBean;
}
Also used : JAXRSClientFactoryBean(org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) QName(javax.xml.namespace.QName) LocatorFeature(org.talend.esb.servicelocator.cxf.LocatorFeature)

Example 2 with LocatorFeature

use of org.talend.esb.servicelocator.cxf.LocatorFeature in project tesb-rt-se by Talend.

the class RuntimeESBConsumerTest method noPropertiesSetProvidesEmptyArgumentList.

@Test
public void noPropertiesSetProvidesEmptyArgumentList() throws Exception {
    QName serviceName = new QName("http://services.talend.org/test/Library/1.0", "LibraryProvider");
    QName portName = new QName("http://services.talend.org/test/Library/1.0", "LibraryHttpPort");
    QName operationName = new QName("http://services.talend.org/test/Library/1.0", "seekBook");
    String publishedEndpointUrl = "local://LibraryHttpPort";
    String wsdlURL = "classpath:/conf/libraryService/Library.wsdl";
    boolean useServiceLocator = false;
    LocatorFeature locatorFeature = null;
    Map<String, String> locatorProps = new HashMap<String, String>();
    EventFeature samFeature = null;
    Map<String, String> samProps = new HashMap<String, String>();
    boolean useServiceRegistry = false;
    EsbSecurity esbSecurity = null;
    Policy policy = null;
    String username = "";
    String password = "";
    String alias = "";
    Map<String, String> clientProperties = new HashMap<String, String>();
    String roleName = "";
    Object securityToken = null;
    Crypto cryptoProvider = null;
    SecurityArguments securityArguments = new SecurityArguments(esbSecurity, policy, username, password, alias, clientProperties, roleName, securityToken, cryptoProvider);
    Bus bus = null;
    boolean logging = false;
    List<Header> soapHeaders = new ArrayList<Header>();
    Feature httpHeadersFeature = null;
    boolean enhancedResponse = false;
    Object correlationIDCallbackHandler = null;
    final boolean useGZipCompression = false;
    RuntimeESBConsumer consumer = new RuntimeESBConsumer(serviceName, portName, operationName, publishedEndpointUrl, wsdlURL, useServiceLocator, locatorFeature, locatorProps, samFeature, samProps, useServiceRegistry, securityArguments, bus, logging, soapHeaders, httpHeadersFeature, enhancedResponse, correlationIDCallbackHandler, useGZipCompression);
    String requestString = "<ns2:SearchFor xmlns:ns2=\"http://types.talend.org/test/Library/Common/1.0\" " + "xmlns:ns3=\"http://types.talend.org/test/GeneralObjects/ErrorHandling/1.0\">" + "<AuthorLastName>Icebear</AuthorLastName><ISBNNumber>123</ISBNNumber></ns2:SearchFor>";
    consumer.invoke(getDocumentFromString(requestString));
}
Also used : Policy(org.apache.neethi.Policy) Bus(org.apache.cxf.Bus) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) EventFeature(org.talend.esb.sam.agent.feature.EventFeature) EventFeature(org.talend.esb.sam.agent.feature.EventFeature) LocatorFeature(org.talend.esb.servicelocator.cxf.LocatorFeature) Feature(org.apache.cxf.feature.Feature) Crypto(org.apache.wss4j.common.crypto.Crypto) Header(org.apache.cxf.headers.Header) EsbSecurity(org.talend.esb.job.controller.ESBEndpointConstants.EsbSecurity) LocatorFeature(org.talend.esb.servicelocator.cxf.LocatorFeature) Test(org.junit.Test)

Aggregations

QName (javax.xml.namespace.QName)2 LocatorFeature (org.talend.esb.servicelocator.cxf.LocatorFeature)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Bus (org.apache.cxf.Bus)1 Feature (org.apache.cxf.feature.Feature)1 Header (org.apache.cxf.headers.Header)1 JAXRSClientFactoryBean (org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean)1 Policy (org.apache.neethi.Policy)1 Crypto (org.apache.wss4j.common.crypto.Crypto)1 Test (org.junit.Test)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1 EsbSecurity (org.talend.esb.job.controller.ESBEndpointConstants.EsbSecurity)1 EventFeature (org.talend.esb.sam.agent.feature.EventFeature)1