Package org.reficio.ws.client

Examples of org.reficio.ws.client.TransmissionException


        verifyServiceBehavior(14);
    }

    @Test
    public void testService15_noSoapAction() throws Exception {
        TransmissionException expected = null;
        try {
            verifyServiceBehavior(15, SKIP_SOAP_ACTION);
        } catch (TransmissionException ex) {
            expected = ex;
        }
        assertNotNull(expected);
        assertEquals(Integer.valueOf(500), expected.getErrorCode());
    }
View Full Code Here


        verifyServiceBehavior(22);
    }

    @Test
    public void testService23() throws Exception {
        TransmissionException expected = null;
        try {
            verifyServiceBehavior(23);
        } catch (TransmissionException ex) {
            expected = ex;
        }
        assertNotNull(expected);
        assertEquals(Integer.valueOf(500), expected.getErrorCode());
    }
View Full Code Here

            HttpResponse response = client.execute(post);
            StatusLine statusLine = response.getStatusLine();
            HttpEntity entity = response.getEntity();
            if (statusLine.getStatusCode() >= 300) {
                EntityUtils.consume(entity);
                throw new TransmissionException(statusLine.getReasonPhrase(), statusLine.getStatusCode());
            }
            return entity == null ? null : EntityUtils.toString(entity);
        } catch (SoapException ex) {
            throw ex;
        } catch (ConnectTimeoutException ex) {
            throw new TransmissionException("Connection timed out", ex);
        } catch (IOException ex) {
            throw new TransmissionException("Transmission failed", ex);
        } catch (RuntimeException ex) {
            post.abort();
            throw new TransmissionException("Transmission aborted", ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.reficio.ws.client.TransmissionException

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.