Package org.apache.axis.handlers.soap

Examples of org.apache.axis.handlers.soap.SOAPService


    /**
     * Test a simple method that reverses a string (with a comma delimiter
     */
    public void testReverseStringWithCommaDelimiter() throws Exception {
        // Register the reverseString service
        SOAPService reverse = new SOAPService(new RPCProvider());
        reverse.setOption("className", "test.RPCDispatch.Service");
        reverse.setOption("allowedMethods", "reverseString2,reverseString");
        provider.deployService(new QName(null,SOAPAction), reverse);

        // invoke the service and verify the result
        assertEquals("Did not reverse the string correctly.", "cba", rpc("reverseString", new Object[] {"abc"}));
    }
View Full Code Here


    /**
     * Test a simple method that reverses a string (with a space delimiter
     */
    public void testReverseStringWithSpaceDelimiter() throws Exception {
        // Register the reverseString service
        SOAPService reverse = new SOAPService(new RPCProvider());
        reverse.setOption("className", "test.RPCDispatch.Service");
        reverse.setOption("allowedMethods", "reverseString2 reverseString");
        provider.deployService(new QName(null,SOAPAction), reverse);

        // invoke the service and verify the result
        assertEquals("Did not reverse the string correctly.", "cba", rpc("reverseString", new Object[] {"abc"}));
    }
View Full Code Here

    /**
     * Test a simple method that reverses a string (with a '*'
     */
    public void testReverseStringWithStar() throws Exception {
        // Register the reverseString service
        SOAPService reverse = new SOAPService(new RPCProvider());
        reverse.setOption("className", "test.RPCDispatch.Service");
        reverse.setOption("allowedMethods", "*");
        provider.deployService(new QName(null,SOAPAction), reverse);

        // invoke the service and verify the result
        assertEquals("Did not reverse the string correctly.", "cba",
                     rpc("reverseString", new Object[] {"abc"}));
View Full Code Here

    /**
     * Test a method that reverses a data structure
     */
    public void testReverseData() throws Exception {
        // Register the reverseData service
        SOAPService reverse = new SOAPService(new RPCProvider());
        reverse.setOption("className", "test.RPCDispatch.Service");
        reverse.setOption("allowedMethods", "reverseData");
        provider.deployService(new QName(null, SOAPAction), reverse);

        // invoke the service and verify the result
        Data input    = new Data(5, "abc", 3);
        Data expected = new Data(3, "cba", 5);
View Full Code Here

    /**
     * Test a simple method that returns a field from the message context
     */
    public void testMessageContextImplicit() throws Exception {
        // Register the targetService service
        SOAPService tgtSvc = new SOAPService(new RPCProvider());
        tgtSvc.setOption("className", "test.RPCDispatch.Service");
        tgtSvc.setOption("allowedMethods", "targetServiceImplicit");
        provider.deployService(new QName(null, SOAPAction), tgtSvc);

        // invoke the service and verify the result
        assertEquals("SOAP Action did not equal the targetService.",
            SOAPAction, rpc("targetServiceImplicit", new Object[] {}));
View Full Code Here

    /**
     * Test a simple method that accepts and returns a null
     */
    public void testNull() throws Exception {
        // Register the echoInt service
        SOAPService echoInt = new SOAPService(new RPCProvider());
        echoInt.setOption("className", "test.RPCDispatch.Service");
        echoInt.setOption("allowedMethods", "echoInt");
        provider.deployService(new QName(null, SOAPAction), echoInt);

        // invoke the service and verify the result
        assertNull("The result was not null as expected.", rpc("echoInt", new Object[] {null}));
    }
View Full Code Here

    /**
     * Test faults
     */
    public void testSimpleFault() throws Exception {
        // Register the reverseData service
        SOAPService simpleFault = new SOAPService(new RPCProvider());
        simpleFault.setOption("className", "test.RPCDispatch.Service");
        simpleFault.setOption("allowedMethods", "simpleFault");
        provider.deployService(new QName(null, SOAPAction), simpleFault);

        try {
            rpc("simpleFault", new Object[] {"foobar"});
        } catch (AxisFault result) {
View Full Code Here

                    sendXSIType = false ;
            }

            // A Literal use service overrides the above settings. Don't
            // send xsi:type, and don't do multiref in that case.
            SOAPService service = msgContext.getService();
            if (service != null) {
                if (service.getUse() != Use.ENCODED) {
                    sendXSIType = false;
                    doMultiRefs = false;
                }
            }
        }
View Full Code Here

    public void testBodyNamespace() throws Exception {
        SimpleProvider provider = new SimpleProvider();

        // register the service with the engine
        SOAPService target = new SOAPService(new RPCProvider());
        target.setOption(JavaProvider.OPTION_CLASSNAME, "test.encoding.TestBody");
        provider.deployService(new QName(null,namespace), target);

        // setup
        AxisEngine engine = new AxisServer(provider);
        engine.init();
View Full Code Here

            transport = defaultConfiguration.getTransport(qname);
        return transport;
    }

    public SOAPService getService(QName qname) throws ConfigurationException {
        SOAPService service = (SOAPService)services.get(qname);
        if ((defaultConfiguration != null) && (service == null))
            service = defaultConfiguration.getService(qname);
        return service;
    }
View Full Code Here

TOP

Related Classes of org.apache.axis.handlers.soap.SOAPService

Copyright © 2018 www.massapicom. 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.