Examples of EndpointInfo


Examples of org.apache.cxf.service.model.EndpointInfo

    public void testRandomPortAllocation() throws Exception {
        transportFactory = new HTTPTransportFactory();
        transportFactory.setBus(BusFactory.getDefaultBus());
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName(new QName("bla", "Service"));
        EndpointInfo ei = new EndpointInfo(serviceInfo, "");
        ei.setName(new QName("bla", "Port"));
       
        Destination d1 = transportFactory.getDestination(ei);
        URL url = new URL(d1.getAddress().getAddress().getValue());
        assertTrue("No random port has been allocated",
                   url.getPort() > 0);
View Full Code Here

Examples of org.apache.cxf.service.model.EndpointInfo

       
        HttpServletRequest httpRequest = EasyMock.createMock(HttpServletRequest.class);
       
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName(new QName("bla", "Service"));
        EndpointInfo ei = new EndpointInfo(serviceInfo, "");
        ei.setName(new QName("bla", "Port"));
       
        final JettyHTTPServerEngine httpEngine = new JettyHTTPServerEngine();
        httpEngine.setContinuationsEnabled(false);
        JettyHTTPServerEngineFactory factory = new JettyHTTPServerEngineFactory() {
            @Override
View Full Code Here

Examples of org.apache.cxf.service.model.EndpointInfo

        transportFactory = new HTTPTransportFactory();
        transportFactory.setBus(BusFactory.getDefaultBus(true));
       
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName(new QName("bla", "Service"));       
        EndpointInfo ei = new EndpointInfo(serviceInfo, "");
        ei.setName(new QName("bla", "Port"));
        ei.setAddress("http://foo");
        Destination d1 = transportFactory.getDestination(ei);
       
        Destination d2 = transportFactory.getDestination(ei);
       
        // Second get should not generate a new destination. It should just retrieve the existing one
View Full Code Here

Examples of org.apache.cxf.service.model.EndpointInfo

        transportFactory = new HTTPTransportFactory();
        transportFactory.setBus(bus);
       
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName(new QName("bla", "Service"));       
        endpointInfo = new EndpointInfo(serviceInfo, "");
        endpointInfo.setName(new QName("bla", "Port"));
        endpointInfo.addExtensor(policy);
       
        engine = EasyMock.createMock(JettyHTTPServerEngine.class);
        EasyMock.replay();
View Full Code Here

Examples of org.apache.cxf.service.model.EndpointInfo

       
       
        engine = EasyMock.createNiceMock(JettyHTTPServerEngine.class);
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName(new QName("bla", "Service"));       
        endpointInfo = new EndpointInfo(serviceInfo, "");
        endpointInfo.setName(new QName("bla", "Port"));
        endpointInfo.setAddress(NOWHERE + "bar/foo");
      
        endpointInfo.addExtensor(policy);
        engine.addServant(EasyMock.eq(new URL(NOWHERE + "bar/foo")),
View Full Code Here

Examples of org.apache.cxf.service.model.EndpointInfo

    public EndpointInfo buildEndpoint(ServiceInfo service, BindingInfo bi, Port port) {
        List<?> elements = port.getExtensibilityElements();
        String ns = null;

        DestinationFactory factory = null;
        EndpointInfo ei = null;

        if (null != elements && elements.size() > 0) {
            for (ExtensibilityElement el : CastUtils.cast(elements, ExtensibilityElement.class)) {
                ns = el.getElementType().getNamespaceURI();
                try {
                    factory = bus.getExtension(DestinationFactoryManager.class).getDestinationFactory(ns);
                } catch (BusException e) {
                    // do nothing
                }
                if (factory != null) {
                    break;
                }
            }
            if (factory == null) {
                ns = ((ExtensibilityElement)elements.get(0)).getElementType().getNamespaceURI();
            }
        }

        if (factory == null) { // get the transport id from bindingInfo
            elements = port.getBinding().getExtensibilityElements();
            if (null != elements && elements.size() > 0) {
                for (ExtensibilityElement el : CastUtils.cast(elements, ExtensibilityElement.class)) {
                    if (el instanceof SOAPBinding) {
                        ns = ((SOAPBinding)el).getTransportURI();
                        break;
                    } else if (el instanceof SOAP12Binding) {
                        ns = ((SOAP12Binding)el).getTransportURI();
                        break;
                        // TODO: this is really ugly, but how to link between
                        // this binding and this transport ?
                    }
                }
            }
            if (ns == null) {
                if (ignoreUnknownBindings) {
                    return null;
                }
                org.apache.cxf.common.i18n.Message msg = new
                    org.apache.cxf.common.i18n.Message("MISSING_DESTINATION_FACTORY",
                                                       LOG,
                                                       port.getName());
                throw new WSDLRuntimeException(msg);
            }
            try {
                factory = bus.getExtension(DestinationFactoryManager.class).getDestinationFactory(ns);
            } catch (BusException e) {
                // do nothing
            }
        }
        if (factory instanceof WSDLEndpointFactory) {
            WSDLEndpointFactory wFactory = (WSDLEndpointFactory)factory;
            ei = wFactory.createEndpointInfo(service, bi,
                                             port.getExtensibilityElements());
        }

        if (ei == null) {
            ei = new EndpointInfo(service, ns);
        }
        copyDocumentation(ei, port);
        ei.setName(new QName(service.getName().getNamespaceURI(), port.getName()));
        ei.setBinding(bi);
        copyExtensors(ei, port.getExtensibilityElements());
        copyExtensionAttributes(ei, port);

        service.addEndpoint(ei);
        DescriptionInfo d = service.getDescription();
View Full Code Here

Examples of org.apache.cxf.service.model.EndpointInfo

     * the Message and that its URL matches the endpoint.
     */
    @Test
    public void testConnectionURL() throws Exception {
        Bus bus = new CXFBusImpl();
        EndpointInfo ei = new EndpointInfo();
        ei.setAddress("http://nowhere.com/bar/foo");
        HTTPConduit conduit = new URLConnectionHTTPConduit(bus, ei, null);
        conduit.finalizeConfig();
   
        Message message = getNewMessage();
       
        conduit.prepare(message);
       
        HttpURLConnection con =
            (HttpURLConnection) message.get("http.connection");
        assertEquals("Unexpected URL address",
                con.getURL().toString(),
                ei.getAddress());
    }
View Full Code Here

Examples of org.apache.cxf.service.model.EndpointInfo

     * ENDPOINT_ADDRESS set on the Message.
     */
    @Test
    public void testConnectionURLOverride() throws Exception {
        Bus bus = new CXFBusImpl();
        EndpointInfo ei = new EndpointInfo();
        ei.setAddress("http://nowhere.null/bar/foo");
        HTTPConduit conduit = new URLConnectionHTTPConduit(bus, ei, null);
        conduit.finalizeConfig();
   
        Message message = getNewMessage();
        message.put(Message.ENDPOINT_ADDRESS, "http://somewhere.different/");
View Full Code Here

Examples of org.apache.cxf.service.model.EndpointInfo

    }
   
    private Object doTestTLSServerParameters() throws Exception {
        Bus bus = new CXFBusImpl();
        EndpointInfo ei = new EndpointInfo();
        ei.setAddress("https://secure.nowhere.null/" + "bar/foo");
        HTTPConduit conduit = new URLConnectionHTTPConduit(bus, ei, null);
        conduit.finalizeConfig();
   
        Message message = getNewMessage();
        // We need an SSL policy, or we can't use "https".
View Full Code Here

Examples of org.apache.cxf.service.model.EndpointInfo

     * EndpointReferenceType for the given endpoint address.
     */
    @Test
    public void testGetTarget() throws Exception {
        Bus bus = new CXFBusImpl();
        EndpointInfo ei = new EndpointInfo();
        ei.setAddress("http://nowhere.com/bar/foo");
        HTTPConduit conduit = new URLConnectionHTTPConduit(bus, ei, null);
        conduit.finalizeConfig();

        EndpointReferenceType target =
            EndpointReferenceUtils.getEndpointReference(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.