/** {@inheritDoc} */ public List<XMLObject> getOrderedChildren() { ArrayList<XMLObject> children = new ArrayList<>(); children.add(header); children.add(body); children.addAll(super.getOrderedChildren()); return Collections.unmodifiableList(children); } }
throw new SOAPException("Could not resolve pipeline", e);
/** * Builds the SOAP message to be encoded. * * @param payload body of the SOAP message */ protected void buildAndStoreSOAPMessage(@Nonnull final XMLObject payload) { Envelope envelope = getSOAPEnvelope(); if (envelope == null) { envelope = envBuilder.buildObject(); storeSOAPEnvelope(envelope); } Body body = envelope.getBody(); if (body == null) { body = bodyBuilder.buildObject(); envelope.setBody(body); } if (!body.getUnknownXMLObjects().isEmpty()) { log.warn("Existing SOAP Envelope Body already contained children"); } body.getUnknownXMLObjects().add(payload); }
SOAPFaultException faultException = new SOAPFaultException(e.getMessage(), e); faultException.setFault(e.getFault()); throw faultException; } catch (SSLException e) { throw new SecurityException("Problem establising TLS connection to: " + endpoint, e); } catch (ComponentInitializationException e) { throw new SOAPException("Problem initializing a SOAP client component", e); } catch (MessageEncodingException e) { throw new SOAPException("Problem encoding SOAP request message to: " + endpoint, e); } catch (MessageDecodingException e) { throw new SOAPException("Problem decoding SOAP response message from: " + endpoint, e); } catch (MessageHandlerException e) { throw new SOAPException("Problem handling SOAP message exchange with: " + endpoint, e); } catch (ClientProtocolException e) { throw new SOAPException("Client protocol problem sending SOAP request message to: " + endpoint, e); } catch (IOException e) { throw new SOAPException("I/O problem with SOAP message exchange with: " + endpoint, e); } finally { if (pipeline != null) {
/** * Process a successful response, i.e. one where the HTTP response code was 200. * * @param httpResponse the HTTP client response * @param soapContext the SOAP11Context instance * * @throws MessageDecodingException if message can not be unmarshalled * @throws IOException if there is a problem with the response entity input stream */ protected void processSuccessResponse(HttpResponse httpResponse, SOAP11Context soapContext) throws MessageDecodingException, IOException { if (httpResponse.getEntity() == null) { throw new MessageDecodingException("No response body from server"); } Envelope soapMessage = (Envelope) unmarshallMessage(httpResponse.getEntity().getContent()); // Defensive sanity check, otherwise body handler could later fail non-gracefully with runtime exception Fault fault = getFault(soapMessage); if (fault != null) { throw new SOAP11FaultDecodingException(fault); } soapContext.setEnvelope(soapMessage); soapContext.setHTTPResponseStatus(httpResponse.getStatusLine().getStatusCode()); }
/** * Builds the SOAP message to be encoded. * * @param payload body of the SOAP message */ protected void buildAndStoreSOAPMessage(@Nonnull final XMLObject payload) { Envelope envelope = getSOAPEnvelope(); if (envelope == null) { envelope = envBuilder.buildObject(); storeSOAPEnvelope(envelope); } Body body = envelope.getBody(); if (body == null) { body = bodyBuilder.buildObject(); envelope.setBody(body); } if (!body.getUnknownXMLObjects().isEmpty()) { log.warn("Existing SOAP Envelope Body already contained children"); } body.getUnknownXMLObjects().add(payload); }
throw new SOAPException("Could not resolve pipeline with name: " + resolvedPipelineName, e);
return new SOAP11FaultDecodingException(fault);
/** * Builds the SOAP message to be encoded. * * @param payload body of the SOAP message */ protected void buildAndStoreSOAPMessage(@Nonnull final XMLObject payload) { Envelope envelope = getSOAPEnvelope(); if (envelope == null) { envelope = envBuilder.buildObject(); storeSOAPEnvelope(envelope); } Body body = envelope.getBody(); if (body == null) { body = bodyBuilder.buildObject(); envelope.setBody(body); } if (!body.getUnknownXMLObjects().isEmpty()) { log.warn("Existing SOAP Envelope Body already contained children"); } body.getUnknownXMLObjects().add(payload); }
@Override protected void buildAndStoreSOAPMessage(final XMLObject payload) { final XMLObjectBuilderFactory builderFactory = XMLObjectProviderRegistrySupport.getBuilderFactory(); final SOAPObjectBuilder<Envelope> envBuilder = (SOAPObjectBuilder<Envelope>) builderFactory.getBuilder(Envelope.DEFAULT_ELEMENT_NAME); final Envelope envelope = envBuilder.buildObject( SOAPConstants.SOAP11_NS, Envelope.DEFAULT_ELEMENT_LOCAL_NAME, OPENSAML_11_SOAP_NS_PREFIX); final SOAPObjectBuilder<Body> bodyBuilder = (SOAPObjectBuilder<Body>) builderFactory.getBuilder(Body.DEFAULT_ELEMENT_NAME); final Body body = bodyBuilder.buildObject( SOAPConstants.SOAP11_NS, Body.DEFAULT_ELEMENT_LOCAL_NAME, OPENSAML_11_SOAP_NS_PREFIX); if(!body.getUnknownXMLObjects().isEmpty()) { LOGGER.warn("Existing SOAP Envelope Body already contained children"); } body.getUnknownXMLObjects().add(payload); envelope.setBody(body); this.storeSOAPEnvelope(envelope); }
val envelope = envelopeBuilder.buildObject(); val body = bodyBuilder.buildObject(); envelope.setBody(body); body.getUnknownXMLObjects().add(samlLogoutRequest);