Package com.izforge.soapdtc.transport

Examples of com.izforge.soapdtc.transport.HttpSoapTransport


            {
                return false;
            }
        });

        HttpSoapTransport soapTransport = new HttpSoapTransport();
        SoapMessage message;
        SoapMessage response;

        // Try without a header handler
        message = SoapMessageUtils.readSoapMessageFromStream(getClass().getResourceAsStream("soap-message.xml"));
        try
        {
            response = soapTransport.sendReceive("http://localhost:8085/dtc/iya", message, null);
            fail("There should have been an exception here!");
        }
        catch (SoapTransportException e)
        {
            SoapMessage msg = e.getSoapMessageWithFault();
            assertNotNull(msg);
            assertTrue(msg.containsFault());
            assertEquals("env:MustUnderstand", msg.getBodyElement().valueOf("env:Fault/env:Code"));
        }

        // Try with a header handler
        servlet.addHeaderHandlerMapping(QName.get("h:plop", "urn:plop:da:plop"), new ISoapHeaderHandler()
        {
            public SoapFault handleHeader(Element header, SoapMessage soapMessage)
            {
                return null;
            }
        });
        response = soapTransport.sendReceive("http://localhost:8085/dtc/iya", message, null);
        assertEquals(0, nodeComparator.compare(message, response));

        // Sollicit-request
        response = soapTransport.receive("http://localhost:8085/dtc/iya", null);
        assertEquals(0, nodeComparator.compare(message, response));

        // Try a non-existent URL
        try
        {
            soapTransport.sendReceive("http://localhost:8085/dtc/plop", message, null);
            fail("This pathinfo should not be handled");
        }
        catch (SoapTransportException e)
        {
        }
View Full Code Here

TOP

Related Classes of com.izforge.soapdtc.transport.HttpSoapTransport

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.