Search in sources :

Example 11 with ServiceImpl

use of org.apache.cxf.service.ServiceImpl in project cxf by apache.

the class ManagedRMManagerTest method createTestEndpoint.

private Endpoint createTestEndpoint() throws Exception {
    ServiceInfo svci = new ServiceInfo();
    svci.setName(new QName(TEST_URI, "testService"));
    Service svc = new ServiceImpl(svci);
    SoapBindingInfo binding = new SoapBindingInfo(svci, WSDLConstants.NS_SOAP11);
    binding.setTransportURI(WSDLConstants.NS_SOAP_HTTP_TRANSPORT);
    EndpointInfo ei = new EndpointInfo();
    ei.setAddress(TEST_URI);
    ei.setName(new QName(TEST_URI, "testPort"));
    ei.setBinding(binding);
    ei.setService(svci);
    return new EndpointImpl(bus, svc, ei);
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) QName(javax.xml.namespace.QName) ServiceImpl(org.apache.cxf.service.ServiceImpl) EndpointImpl(org.apache.cxf.endpoint.EndpointImpl) SoapBindingInfo(org.apache.cxf.binding.soap.model.SoapBindingInfo) Service(org.apache.cxf.service.Service)

Example 12 with ServiceImpl

use of org.apache.cxf.service.ServiceImpl in project tesb-rt-se by Talend.

the class MessageToEventMapperTest method getTestMessage.

private Message getTestMessage() throws IOException, EndpointException {
    Message message = new MessageImpl();
    ExchangeImpl exchange = new ExchangeImpl();
    ServiceInfo serviceInfo = new ServiceInfo();
    InterfaceInfo interfaceInfo = new InterfaceInfo(serviceInfo, new QName("interfaceNs", "interfaceName"));
    serviceInfo.setInterface(interfaceInfo);
    SoapBindingInfo bInfo = new SoapBindingInfo(serviceInfo, WSDLConstants.NS_SOAP12);
    bInfo.setTransportURI(TransportType);
    OperationInfo opInfo = new OperationInfo();
    opInfo.setName(new QName("namespace", "opName"));
    BindingOperationInfo bindingOpInfo = new BindingOperationInfo(bInfo, opInfo);
    exchange.put(BindingOperationInfo.class, bindingOpInfo);
    SoapBinding binding = new SoapBinding(bInfo);
    exchange.put(Binding.class, binding);
    String ns = "ns";
    EndpointInfo ei = new EndpointInfo(serviceInfo, ns);
    ei.setAddress(Address);
    Service service = new ServiceImpl();
    Bus bus = BusFactory.getThreadDefaultBus();
    Endpoint endpoint = new EndpointImpl(bus, service, ei);
    exchange.put(Endpoint.class, endpoint);
    message.setExchange(exchange);
    FlowIdHelper.setFlowId(message, FlowID);
    Principal principal = new X500Principal(PrincipalString);
    SecurityContext sc = new DefaultSecurityContext(principal, new Subject());
    message.put(SecurityContext.class, sc);
    CachedOutputStream cos = new CachedOutputStream();
    InputStream is = new ByteArrayInputStream(TESTCONTENT.getBytes("UTF-8"));
    IOUtils.copy(is, cos);
    message.setContent(CachedOutputStream.class, cos);
    CustomInfo customInfo = CustomInfo.getOrCreateCustomInfo(message);
    customInfo.put("key1", "value1");
    return message;
}
Also used : BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) DefaultSecurityContext(org.apache.cxf.interceptor.security.DefaultSecurityContext) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) Message(org.apache.cxf.message.Message) CachedOutputStream(org.apache.cxf.io.CachedOutputStream) ServiceInfo(org.apache.cxf.service.model.ServiceInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) Endpoint(org.apache.cxf.endpoint.Endpoint) CustomInfo(org.talend.esb.sam.agent.message.CustomInfo) Bus(org.apache.cxf.Bus) QName(javax.xml.namespace.QName) ServiceImpl(org.apache.cxf.service.ServiceImpl) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) EndpointImpl(org.apache.cxf.endpoint.EndpointImpl) Service(org.apache.cxf.service.Service) SoapBinding(org.apache.cxf.binding.soap.SoapBinding) Subject(javax.security.auth.Subject) ByteArrayInputStream(java.io.ByteArrayInputStream) SoapBindingInfo(org.apache.cxf.binding.soap.model.SoapBindingInfo) DefaultSecurityContext(org.apache.cxf.interceptor.security.DefaultSecurityContext) SecurityContext(org.apache.cxf.security.SecurityContext) X500Principal(javax.security.auth.x500.X500Principal) InterfaceInfo(org.apache.cxf.service.model.InterfaceInfo) MessageImpl(org.apache.cxf.message.MessageImpl) ExchangeImpl(org.apache.cxf.message.ExchangeImpl) X500Principal(javax.security.auth.x500.X500Principal) Principal(java.security.Principal)

Aggregations

ServiceImpl (org.apache.cxf.service.ServiceImpl)12 Service (org.apache.cxf.service.Service)8 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)8 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)7 QName (javax.xml.namespace.QName)6 Endpoint (org.apache.cxf.endpoint.Endpoint)6 EndpointImpl (org.apache.cxf.endpoint.EndpointImpl)6 ExchangeImpl (org.apache.cxf.message.ExchangeImpl)5 MessageImpl (org.apache.cxf.message.MessageImpl)5 Exchange (org.apache.cxf.message.Exchange)4 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)4 OperationInfo (org.apache.cxf.service.model.OperationInfo)4 Bus (org.apache.cxf.Bus)3 SoapBindingInfo (org.apache.cxf.binding.soap.model.SoapBindingInfo)3 Message (org.apache.cxf.message.Message)3 BindingInfo (org.apache.cxf.service.model.BindingInfo)3 InterfaceInfo (org.apache.cxf.service.model.InterfaceInfo)3 Method (java.lang.reflect.Method)2 ExtensionManagerBus (org.apache.cxf.bus.extension.ExtensionManagerBus)2 Message (org.apache.cxf.common.i18n.Message)2