Examples of AddNumbersPortType


Examples of org.apache.axis2.jaxws.sample.addnumbers.AddNumbersPortType

        // Create Dispatch should work on a WSDL declared port prior to a getPort
        // and again after the call to getPort
        QName validPortQName = new QName(VALID_SERVICE_NAMESPACE, VALID_PORT_S1P1);
        Dispatch<String> dispatch = service1.createDispatch(validPortQName, String.class, null);
        assertNotNull(dispatch);
        AddNumbersPortType addNumbersPortS1P1 = service1.getPort(validPortQName, AddNumbersPortType.class);
        assertNotNull(addNumbersPortS1P1);
       
        // Create Dispatch should NOT work on a dynamic port that has not been added yet
        // but should work after it has been added
        QName addedPort = new QName(VALID_SERVICE_NAMESPACE, "addedPortS1P1");
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.addnumbers.AddNumbersPortType

            // Expected path
        }
        catch (Exception ex) {
            fail("Unexpected exception thrown " + ex.toString());
        }
        AddNumbersPortType addNumbersPortS1P1 = service1.getPort(validPortQName, AddNumbersPortType.class);
        Dispatch<String> dispatch = service1.createDispatch(validPortQName, String.class, null);
        assertNotNull(dispatch);

        // Create Dispatch should NOT work on a dynamic port that has not been added yet
        // but should work after it has been added
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.addnumbers.AddNumbersPortType

    public void testAddNumbers() throws Exception {
        TestLogger.logger.debug("----------------------------------");
        TestLogger.logger.debug("test: " + getName());

        AddNumbersService service = new AddNumbersService();
        AddNumbersPortType proxy = service.getAddNumbersPort();

        BindingProvider p = (BindingProvider) proxy;
        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
        int total = proxy.addNumbers(10, 10);

        TestLogger.logger.debug("Total =" + total);
        TestLogger.logger.debug("----------------------------------");

        assertEquals("sum", 20, total);
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.addnumbers.AddNumbersPortType

        try {
            TestLogger.logger.debug("----------------------------------");
            TestLogger.logger.debug("test: " + getName());
           
            AddNumbersService service = new AddNumbersService();
            AddNumbersPortType proxy = service.getAddNumbersPort();
           
            BindingProvider bp = (BindingProvider) proxy;
            bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                    axisEndpoint);
            proxy.oneWayInt(11);
            TestLogger.logger.debug("----------------------------------");
        } catch (Exception e) {
            e.printStackTrace();
            fail();
        }      
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.addnumbers.AddNumbersPortType

        URL wsdlURL = DescriptionTestUtils2.getWSDLURL("WSDLMultiTests.wsdl");

        QName serviceQN = new QName(VALID_SERVICE_NAMESPACE, VALID_SERVICE_LOCALPART_3);
        Service service = Service.create(wsdlURL, serviceQN);
        assertNotNull(service);
        AddNumbersPortType selectPort = service.getPort(AddNumbersPortType.class);
        BindingProvider bindingProvider = (BindingProvider)Proxy.getInvocationHandler(selectPort);
        EndpointDescription endpointDesc = bindingProvider.getEndpointDescription();
        QName selectedPortQName = endpointDesc.getPortQName();
        assertNotNull(selectedPortQName);
        // We expect the first port in the WSDL which uses the PortType for the SEI AddNumbersPortType to be selected
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    @Test
    public void testDisableServerSide() throws Exception {
        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();

        AddNumbersPortType port = getService().getAddNumbersPort();

        ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                                        "http://localhost:"
                                                        + PORT + "/jaxws/add");

        assertEquals(3, port.addNumbers(1, 2));

        String expectedOut = "http://apache.org/cxf/systest/ws/addr_feature/AddNumbersPortType/addNumbersRequest";
        String expectedIn = "http://www.w3.org/2005/08/addressing";
       
        assertLogContains(output.toString(), "//wsa:Action", expectedOut);
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    @Test
    public void testDisableAll() throws Exception {
        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();

        AddNumbersPortType port = getService().getAddNumbersPort(new AddressingFeature(false));

        ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                                        "http://localhost:"
                                                        + PORT + "/jaxws/add");

        assertEquals(3, port.addNumbers(1, 2));

        String expectedOut = "http://www.w3.org/2005/08/addressing";
        String expectedIn = "http://www.w3.org/2005/08/addressing";
       
        assertTrue(output.toString().indexOf(expectedOut) == -1);
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    }
   
    //CXF-3060
    @Test
    public void testDisableServerEnableClientRequired() throws Exception {
        AddNumbersPortType port = getService().getAddNumbersPort(new AddressingFeature(true, true));

        ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                                        "http://localhost:" + PORT + "/jaxws/add");
        try {
            port.addNumbers(1, 2);
            fail("Expected missing WSA header exception");
        } catch (Exception e) {
            assertTrue("expected WebServiceException", e instanceof WebServiceException);
            String expected = "A required header representing a Message Addressing"
                              + " Property is not present";
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    public void testBasicInvocation() throws Exception {
        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();
       
        Response<AddNumbersResponse> resp;
        AddNumbersPortType port = getPort();

        ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                                        "http://localhost:" + PORT + "/jaxws/add");

        assertEquals(3, port.addNumbers(1, 2));

        String base = "http://apache.org/cxf/systest/ws/addr_feature/AddNumbersPortType/";

        assertLogContains(output.toString(), "//wsa:Action", base + "addNumbersRequest");
        assertLogContains(input.toString(), "//wsa:Action", base + "addNumbersResponse");

        resp = port.addNumbers3Async(1, 2);
        assertEquals(3, resp.get().getReturn());

        ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                                        "http://localhost:" + PORT + "/doesntexist");
        resp = port.addNumbers3Async(1, 2);
        try {
            resp.get();
        } catch (ExecutionException ex) {
            assertTrue("Found " + ex.getCause().getClass(), ex.getCause() instanceof IOException);
            Client c = ClientProxy.getClient(port);
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

        String base = "http://apache.org/cxf/systest/ws/addr_feature/AddNumbersPortType/";

        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();

        AddNumbersPortType port = getPort();
        ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                                        "http://localhost:" + PORT + "/jaxws/add-provider");
        assertEquals(3, port.addNumbers(1, 2));


        assertLogContains(output.toString(), "//wsa:Action", base + "addNumbersRequest");
        assertLogContains(input.toString(), "//wsa:Action", base + "addNumbersResponse");

        output.reset();
        input.reset();
       
        ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
            "http://localhost:" + PORT + "/jaxws/add-providernows");
        assertEquals(3, port.addNumbers(1, 2));

        assertLogContains(output.toString(), "//wsa:Action", base + "addNumbersRequest");
        assertLogContains(input.toString(), "//wsa:Action", base + "addNumbersResponse");
    }
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.