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);
}
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;
}
Aggregations