Package org.opensaml.ws.soap.client

Examples of org.opensaml.ws.soap.client.SOAPClientException


            if (result == HttpStatus.SC_OK) {
                processSuccessfulResponse(post, messageContext);
            } else if (result == HttpStatus.SC_INTERNAL_SERVER_ERROR) {
                processFaultResponse(post, messageContext);
            } else {
                throw new SOAPClientException("Received " + result + " HTTP response status code from HTTP request to "
                        + endpoint);
            }
        } catch (IOException e) {
            throw new SOAPClientException("Unable to send request to " + endpoint, e);
        } finally {
            if (post != null) {
                post.releaseConnection();
            }
        }
View Full Code Here


                log.debug("Outbound SOAP message is:\n" + XMLHelper.prettyPrintXML(marshaller.marshall(message)));
            }
            XMLHelper.writeNode(marshaller.marshall(message), writer);
            return new ByteArrayRequestEntity(arrayOut.toByteArray(), "text/xml");
        } catch (MarshallingException e) {
            throw new SOAPClientException("Unable to marshall SOAP envelope", e);
        }
    }
View Full Code Here

        try {
            Envelope response = unmarshallResponse(httpMethod.getResponseBodyAsStream());
            messageContext.setInboundMessage(response);
            evaluateSecurityPolicy(messageContext);
        } catch (IOException e) {
            throw new SOAPClientException("Unable to read response", e);
        }
    }
View Full Code Here

            Envelope response = unmarshallResponse(httpMethod.getResponseBodyAsStream());
            messageContext.setInboundMessage(response);

            List<XMLObject> faults = response.getBody().getUnknownXMLObjects(Fault.DEFAULT_ELEMENT_NAME);
            if (faults.size() < 1) {
                throw new SOAPClientException("HTTP status code was 500 but SOAP response did not contain a Fault");
            }
            Fault fault = (Fault) faults.get(0);

            log.debug("SOAP fault code {} with message {}", fault.getCode().getValue(), fault.getMessage().getValue());
            SOAPFaultException faultException = new SOAPFaultException("SOAP Fault: " + fault.getCode().getValue()
                    + " Fault Message: " + fault.getMessage().getValue());
            faultException.setFault(fault);
            throw faultException;
        } catch (IOException e) {
            throw new SOAPClientException("Unable to read response", e);
        }
    }
View Full Code Here

                log.debug("Inbound SOAP message was:\n" + XMLHelper.prettyPrintXML(responseElem));
            }
            Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(responseElem);
            return (Envelope) unmarshaller.unmarshall(responseElem);
        } catch (XMLParserException e) {
            throw new SOAPClientException("Unable to parse the XML within the response", e);
        } catch (UnmarshallingException e) {
            throw new SOAPClientException("unable to unmarshall the response DOM", e);
        }
    }
View Full Code Here

            policy = policyResolver.resolveSingle(messageContext);
            if (policy == null) {
                return;
            }
        } catch (SecurityException e) {
            throw new SOAPClientException("Unable to resolve security policy for inbound SOAP response", e);
        }

        try {
            log.debug("Evaluating security policy for inbound SOAP response");
            policy.evaluate(messageContext);
        } catch (SecurityException e) {
            throw new SOAPClientException("Inbound SOAP response does not meet security policy", e);
        }
    }
View Full Code Here

            if (result == HttpStatus.SC_OK) {
                processSuccessfulResponse(post, messageContext);
            } else if (result == HttpStatus.SC_INTERNAL_SERVER_ERROR) {
                processFaultResponse(post, messageContext);
            } else {
                throw new SOAPClientException("Received " + result + " HTTP response status code from HTTP request to "
                        + endpoint);
            }
        } catch (IOException e) {
            throw new SOAPClientException("Unable to send request to " + endpoint, e);
        } finally {
            if (post != null) {
                post.releaseConnection();
            }
        }
View Full Code Here

                log.debug("Outbound SOAP message is:\n" + XMLHelper.prettyPrintXML(marshaller.marshall(message)));
            }
            XMLHelper.writeNode(marshaller.marshall(message), writer);
            return new ByteArrayRequestEntity(arrayOut.toByteArray(), "text/xml");
        } catch (MarshallingException e) {
            throw new SOAPClientException("Unable to marshall SOAP envelope", e);
        }
    }
View Full Code Here

        try {
            Envelope response = unmarshallResponse(httpMethod.getResponseBodyAsStream());
            messageContext.setInboundMessage(response);
            evaluateSecurityPolicy(messageContext);
        } catch (IOException e) {
            throw new SOAPClientException("Unable to read response", e);
        }
    }
View Full Code Here

            Envelope response = unmarshallResponse(httpMethod.getResponseBodyAsStream());
            messageContext.setInboundMessage(response);

            List<XMLObject> faults = response.getBody().getUnknownXMLObjects(Fault.DEFAULT_ELEMENT_NAME);
            if (faults.size() < 1) {
                throw new SOAPClientException("HTTP status code was 500 but SOAP response did not contain a Fault");
            }
            Fault fault = (Fault) faults.get(0);

            log.debug("SOAP fault code {} with message {}", fault.getCode().getValue(), fault.getMessage().getValue());
            SOAPFaultException faultException = new SOAPFaultException("SOAP Fault: " + fault.getCode().getValue()
                    + " Fault Message: " + fault.getMessage().getValue());
            faultException.setFault(fault);
            throw faultException;
        } catch (IOException e) {
            throw new SOAPClientException("Unable to read response", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.opensaml.ws.soap.client.SOAPClientException

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.