Load the Response with the provided XML string (not base64 encoded)

@param ssoService
Maestrano ssOSsoService
@param String
xml response provided by the SAML idp
6054
public static Response loadFromXML(Sso ssoService, String xml) throws CertificateException, ParserConfigurationException, SAXException, IOException {
		return new Response(ssoService.getSamlSettings().getIdpCertificate(), xml);
	}
1317067
protected Map<String, Object> toMap(final String xml) {
        XmlReaders readers = readResp(xml);
        return Maps.toMap(readers);
    }
169971
private void initXmlBundle() throws CmsException {

        CmsFile file = m_cms.readFile(m_resource);
        m_bundleFiles.put(null, m_resource);
        m_xmlBundle = CmsXmlContentFactory.unmarshal(m_cms, file);
        initKeySetForXmlBundle();

    }
116644
private function loadFromExtensions(\DOMDocument $xml)
    {
        foreach ($xml->documentElement->childNodes as $node) {
            if (!$node instanceof \DOMElement || self::NS === $node->namespaceURI) {
                continue;
            }

            $values = static::convertDomElementToArray($node);
            if (!is_array($values)) {
                $values = array();
            }

            $this->container->loadFromExtension($node->namespaceURI, $values);
        }
    }
424779
public function loadXml($xml, $options = null)
    {
        return $this->load($xml, false, Document::TYPE_XML, $options);
    }
214426
def parse_soap_enveloped_saml_thingy(text, expected_tags):
    
    envelope = defusedxml.ElementTree.fromstring(text)

    # Make sure it's a SOAP message
    assert envelope.tag == '{%s}Envelope' % soapenv.NAMESPACE

    assert len(envelope) >= 1
    body = None
    for part in envelope:
        if part.tag == '{%s}Body' % soapenv.NAMESPACE:
            assert len(part) == 1
            body = part
            break

    if body is None:
        return ""

    saml_part = body[0]
    if saml_part.tag in expected_tags:
        return ElementTree.tostring(saml_part, encoding="UTF-8")
    else:
        raise WrongMessageType("Was '%s' expected one of %s" % (saml_part.tag,
                                                                expected_tags))
716809
protected void handleSloProfileRequest(final HttpServletResponse response,
                                           final HttpServletRequest request,
                                           final BaseHttpServletRequestXMLMessageDecoder decoder) throws Exception {
        val logout = getSamlProfileHandlerConfigurationContext().getCasProperties().getAuthn().getSamlIdp().getLogout();
        if (logout.isSingleLogoutCallbacksDisabled()) {
            LOGGER.info("Processing SAML2 IdP SLO requests is disabled");
            return;
        }

        val pair = getSamlProfileHandlerConfigurationContext().getSamlHttpRequestExtractor().extract(request, decoder, LogoutRequest.class);
        val logoutRequest = (LogoutRequest) pair.getKey();
        val ctx = pair.getValue();

        if (logout.isForceSignedLogoutRequests() && !SAMLBindingSupport.isMessageSigned(ctx)) {
            throw new SAMLException("Logout request is not signed but should be.");
        }

        if (SAMLBindingSupport.isMessageSigned(ctx)) {
            val entityId = SamlIdPUtils.getIssuerFromSamlObject(logoutRequest);
            LOGGER.trace("SAML logout request from entity id [{}] is signed", entityId);
            val registeredService = getSamlProfileHandlerConfigurationContext().getServicesManager().findServiceBy(entityId, SamlRegisteredService.class);
            LOGGER.trace("SAML registered service tied to [{}] is [{}]", entityId, registeredService);
            val facade = SamlRegisteredServiceServiceProviderMetadataFacade.get(
                getSamlProfileHandlerConfigurationContext().getSamlRegisteredServiceCachingMetadataResolver(), registeredService, entityId).get();
            LOGGER.trace("Verifying signature on the SAML logout request for [{}]", entityId);
            getSamlProfileHandlerConfigurationContext().getSamlObjectSignatureValidator()
                .verifySamlProfileRequestIfNeeded(logoutRequest, facade, request, ctx);
        }
        SamlUtils.logSamlObject(getSamlProfileHandlerConfigurationContext().getOpenSamlConfigBean(), logoutRequest);
        response.sendRedirect(getSamlProfileHandlerConfigurationContext().getCasProperties().getServer().getLogoutUrl());
    }
909267
def load(xmlstr):
        
        try:
            xml = ElementTree.fromstring(xmlstr)
        except StandardError:
            return None

        return XWalkthrough.fromXml(xml)
663110
function(url, callback) {
			JSDAS.XMLLoader.load(url, function(xml) {
				callback(JSDAS.parseDSN(xml, 'v153'));
			});
		}
639632
protected XmlPullParser loadXml(String source) throws UnsupportedEncodingException, XmlPullParserException, IOException {
		return loadXml(new ByteArrayInputStream(source.getBytes("UTF-8")));
	}
1247771
private byte[] filterXML(HttpServletRequest request,
                             DataResponseWrapper response)
            throws ServletException {
        byte[] data = response.getData();
        DocumentBuilder docBuilder = null;
        Document doc = null;

        try {
            synchronized(BUILDER_FACTORY){
                docBuilder =
                        BUILDER_FACTORY.newDocumentBuilder();
            }
            doc = docBuilder.parse(new ByteArrayInputStream(data));
        } catch (Exception e) {
            throw new ServletException(e);
        }

        XPath xpath;
        synchronized(XPATH_FACTORY){
            xpath = XPATH_FACTORY.newXPath();
        }
        xpath.setNamespaceContext(TYPES_NAMESPACE);
        NodeList rows = null;
        try {
            rows =
                    (NodeList) xpath
                            .evaluate("/:result/:resultList/:objectFields/:pid",
                                      doc,
                                      XPathConstants.NODESET);
        } catch (XPathExpressionException xpe) {
            throw new ServletException("Error parsing XML for search results: ",
                                       xpe);
        }

        if (rows.getLength() == 0) {
            logger.debug("No results to filter.");

            return data;
        }

        Map<String, Node> pids = new HashMap<String, Node>();
        for (int x = 0; x < rows.getLength(); x++) {
            Node pid = rows.item(x);
            pids.put(pid.getFirstChild().getNodeValue(), pid.getParentNode());
        }

        Set<Result> results = evaluatePids(pids.keySet(), request, response);

        for (Result r : results) {
            String resource = r.getResource();
            if (resource == null || resource.isEmpty()) {
                logger.warn("This resource has no resource identifier in the xacml response results!");
            } else if (logger.isDebugEnabled()) {
                logger.debug("Checking: {}", resource);
            }

            int lastSlash = resource.lastIndexOf('/');
            String rid = resource.substring(lastSlash+1);

            if (r.getStatus().getCode().contains(Status.STATUS_OK)
                    && r.getDecision() != Result.DECISION_PERMIT) {
                Node node = pids.get(rid);
                node.getParentNode().removeChild(node);
                logger.debug("Removing: {} [{}]", resource, rid);
            }
        }
        // since namespaces are disabled, set the attribute explicitly
        doc.getDocumentElement().setAttribute("xmlns", "http://www.fedora.info/definitions/1/0/types/");
        Source src = new DOMSource(doc);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        javax.xml.transform.Result dst = new StreamResult(os);
        try {
            xFormer.transform(src, dst);
        } catch (TransformerException te) {
            throw new ServletException("error generating output", te);
        }

        return os.toByteArray();
    }
1085656
public function loadXml($sXml, $oDomDocument = null)
    {
        if (!$oDomDocument) {
            $oDomDocument = new DOMDocument('1.0', 'utf-8');
        }

        libxml_use_internal_errors(true);
        $oDomDocument->loadXML($sXml);
        $errors = libxml_get_errors();
        $blLoaded = empty($errors);
        libxml_clear_errors();

        if ($blLoaded) {
            return $oDomDocument;
        }

        return false;
    }
887201
public function decodeResponse($response) {

        $xml_data = simplexml_load_string($response);

        if ( $xml_data === false ) throw new XmlrpcException("Not a valid XMLRPC response");

        $data = array();

        try {

            if ( isset($xml_data->fault) ) {

                $this->is_fault = true;

                array_push($data, $this->decodeValue($xml_data->fault->value));

            } else if ( isset($xml_data->params) ) {

                foreach ( $xml_data->params->param as $param ) array_push($data, $this->decodeValue($param->value));

            } else throw new XmlrpcException("Uncomprensible response");

        } catch (XmlrpcException $xe) {
            
            throw $xe;
            
        }

        return isset($data[0]) ? $data[0] : $data;

    }
417577
protected function createResponse($xml)
    {
        $requestClass = get_class($this);
        $responseClass = substr($requestClass, 0, -7) . 'Response';
        return $this->response = new $responseClass($this, $xml);
    }
1061440
public function loadXML($xml_data)
    {
        $this->xml_data = $xml_data;
        $this->xml = new \sasco\LibreDTE\XML();
        if (!$this->xml->loadXML($this->xml_data)) {
            return false;
        }
        $this->toArray();
        return $this->xml;
    }
634918
public void parseString(String xml) throws ParserException {

        try {
            nanoElement.parseString(xml);
        } catch (XMLParseException e) {
            throw new ParserException(e.getMessage());
        }
    }
486966
public function dontSeeXmlResponseEquals($xml)
    {
        \PHPUnit\Framework\Assert::assertXmlStringNotEqualsXmlString(
            $this->connectionModule->_getResponseContent(),
            $xml
        );
    }