Overrated query leads to poor performance – TVF with XML processing

Today I asked a question about poor query performance. This query had many links over many calls. I think I've noticed which view is a problem for SQL Server. Here is an up-to-date query plan for the selected execution in this view: https://www.brentozar.com/pastetheplan/?id=BJB4WOV6S As you can see, SQL Server greatly overestimates the number of rows and the amount of memory required. Outter Apply is used to run TVF, which returns processed XML. XMLs are rather small. I wonder how I can avoid such overestimation (and what I can say). Should I create XML indexes for my spreadsheet?

xml – How to add RSS feeds from feedburner.com to Thunderbird

I've found out that Google has a security blog and want to add the RSS feed to my list of favorite RSS feeds on Thunderbird:

Enter image description here

Unfortunately, feedburner.com offers a strange list of RSS feeds: My Yahoo, Free, Netvibes, SubToMe, RSSOwl, NewsFire, etc … None of these feeds looks like an unformatted XML feed to me.

Enter image description here

I see that someone is already facing this problem: https://stackoverflow.com/questions/4687042/getting-raw-xml-data-from-a-feedburner-rss-feed. The hack

view-source:http://feeds.feedburner.com/GoogleOnlineSecurityBlog

really shows an XML page, but I can not paste it into Thunderbird.

Why does an old and basic technology like the RSS feed have to be so complicated? And is there a solution to this problem?

Is feedburner.com actively refusing users to extrapolate the raw XML feed for a specific purpose? I do not get it.

api – How to retrieve XML data of the post method in Magento2

We have to implement the punchout concept in magento2. There is a third-party system that sends data cXML Formatting on Magento 2 endpoint. We need to retrieve and process this data in Magento2 and return the data in the form of cXML Format.

That's what we've implemented vie / api / punchout Controller concept instead of REST APIs. This works if we use the PUT method, but not the POST method.

Note: This should work for the POST method.

https://drive.google.com/file/d/1b_aQdjNuamo1VLsLzts0nAsuPGUFjl2H/view

https://codeshare.io/alW8lB

xml – Generate wsse: Security in SOAPHeaderElement with JAVA

I need to generate the following SOAP header:



    

        APP-DCTPNSE-CAN-CR1

        NgEsD3WVOn

        xmPk+9d5IB6z451tPdJ845UZSolA2L

        2019-09-20T09:38:15Z

    

 

I am using the following code (a calling class must have the data type SOAPHeaderElement):

public static SOAPHeaderElement generateHeaderBlock(String user, String password){
        System.out.println("Se entra en el metodo generateheaderBlock");
        SOAPHeaderElement security = null;


        // Defines some namespace and URL constants
        String WSSE = "wsse";
        String WSU = "wsu";
        String XMLNS = "xmlns";
        String WS_SEC_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
        String WS_UTI_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
        String WS_SOAP_URL = "http://schemas.xmlsoap.org/soap/envelope/";

        try {

            System.out.println("Entramos en el try de generateheaderBlock");
            SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
            SOAPPart sOAPPart = soapMessage.getSOAPPart();
            SOAPEnvelope envelope = sOAPPart.getEnvelope();

            QName headerSecurity = new QName(WS_SEC_NS, "Security");
             AtomicReference header 
                = new AtomicReference
                    (new SOAPHeaderElement(headerSecurity) {                       
                       /**
                         * 
                         */
                        private static final long serialVersionUID = 6246594829237893452L;
                    {  
                        String uuid = UUID.randomUUID().toString();
                        System.out.println("uuid: " + uuid);

                        Name userTokenElementName = envelope.createName("UsernameToken", WSSE, WS_UTI_NS); 
                        SOAPElement userNameToken = addChildElement(userTokenElementName);
                        userNameToken.removeNamespaceDeclaration(XMLNS);
                        userNameToken.addNamespaceDeclaration(WSU + ":Id", "SecurityToken-" + uuid);
                        System.out.println("userNameToken creado: " + userNameToken.toString());

                        Name userNameName = envelope.createName("Username", WSSE, WS_UTI_NS); 
                        SOAPElement userName = userNameToken.addChildElement(userNameName);
                        userName.removeNamespaceDeclaration(WSSE);
                        userName.addTextNode(user);
                        System.out.println("userName creado: " + userName.toString());

                        Name contrasenaName = envelope.createName("Password", WSSE, WS_UTI_NS); 
                        SOAPElement contrasena = userNameToken.addChildElement(contrasenaName);
                        contrasena.addTextNode(password);
                        contrasena.setAttribute("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText");
                        System.out.println("password creado: " + contrasena.toString());

                        Name codigoGeneradoName = envelope.createName("Nonce", WSSE, WS_UTI_NS);
                        String codigoGenerado = new String(Base64.encode((uuid + "_" + (System.currentTimeMillis() / 1000)).getBytes()));
                        SOAPElement nonce = userNameToken.addChildElement(codigoGeneradoName);
                        nonce.removeNamespaceDeclaration(WSSE);
                        nonce.addTextNode(codigoGenerado);
                        System.out.println("nonce creado: " + nonce.toString());

                        String fechaCreacion = String.valueOf(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(new Date()));
                        Name createdName = envelope.createName("Created", WSU, WS_UTI_NS);
                        SOAPElement created = userNameToken.addChildElement("Created", "wsse");
                        //created.removeNamespaceDeclaration(WSSE);
                        created.removeContents();
                        created.setPrefix(WSU);
                        created.addTextNode(fechaCreacion);
                        System.out.println("fecha creada: " + created.toString());
                       }
                       @Override
                       public void setAttribute(String namespace, String localName, String value) {
                         if (!Constants.ATTR_MUST_UNDERSTAND.equals(localName)) {  //Or any other attribute name you'd want to avoid
                           super.setAttribute(namespace, localName, value);
                         }
                       }
                    });
            security = header.get();
            security.setPrefix(WSSE);
            SOAPFactory soapFactory = SOAPFactory.newInstance();
            security.addAttribute(soapFactory.createName("soap:mustUnderstand"),"1");
            Name segundaParteSeg  = envelope.createName("xmlns:soap");
            security.addAttribute(segundaParteSeg, WS_SOAP_URL);
            security.setActor(null);
            security.setMustUnderstand(true);
            System.out.println("security completada: " + security.toString());

        } catch (SOAPException e) {
            // TODO Auto-generated catch block
            System.out.println("SOAPException. Fallo en el metodo generateHeaderBlock, Motivo: " + e.getMessage());
            e.printStackTrace();
        } catch (Exception e) {
            System.out.println("Exception. Fallo en el metodo generateHeaderBlock, Motivo: " + e.getMessage());
            e.printStackTrace();
        }

        System.out.println("Se sale en el metodo generateHeaderBlock con exito");   
        return security;
    }

When executed, however, the following is formed:


    
        APP-DCTPNSE-CAN-CR1
        NgEsD3WVOn
        NWIwNDdiY2UtMWFjMi00ZTVkLWJlZDAtNTYzOTcwNmY4ZTkzXzE1NzQ2NzQyNzA=
        2019-11-25T10:31:10Z
    

I want to know how to develop the code so that the "UsernameToken" node will appear as "xmlns: wsu" instead of "xmlns: wsse". I also want to know how the Created node is left with the value of the current date, as it is displayed with the xmlns: wsu attribute. Also, in the parent Security node, the attributes are displayed in the order in which they appear in the header that I entered first

If you have any questions or explanations, let me know and I'll check it.

Many thanks

Update, insert, and delete XML in MySQL with PHP

I'm working on a web that imports data from an XML archive into a database in MySQL and then displays that data in the frontend of the site.
I've looked at articles to do that, and I'm doing the insertion correctly, but I can not delete or update.
I will show my data and try to explain the best that I can.
I have a PHP called importacion.php and it has the following code:

Importación inmuebles




When I upload the XML and click on the button, we follow to _import.php, which has the following code:

 prepare($query);
            for($i = 0; $i < count($data); $i++)
            {
             $statement->execute(
              array(
               ':idInmueble'  => $data->Inmueble($i)->Id,
               ':fechaInmueble'  => $data->Inmueble($i)->Fecha,
               ':refInmueble' => $data->Inmueble($i)->Referencia,
               ':grupoInmueble'   => $data->Inmueble($i)->GrupoInmueble
              )
             );

            }
            $result = $statement->fetchAll();
            if(isset($result))
            {
             $output = '
Importación realizada correctamente
'; } } else { $output = '
Archivo no aceptado
'; } } else { $output = '
Por favor selecciona un archivo XML
'; } echo $output;

This code works fine, but I can not update or delete it when the data in the XML is updated.

Now I've tried updating the query, but it's not working:

prepare($query);
            for($i = 0; $i < count($data); $i++)
            {
             $statement->execute(
              array(
               ':idInmueble'  => $data->Inmueble($i)->Id,
               ':fechaInmueble'  => $data->Inmueble($i)->Fecha,
               ':refInmueble' => $data->Inmueble($i)->Referencia,
               ':grupoInmueble'   => $data->Inmueble($i)->GrupoInmueble
              )
             );

            }
            $result = $statement->fetchAll();
            if(isset($result))
            {
             $output = '
Importación realizada correctamente
'; } } else { $output = '
Archivo no aceptado
'; } } else { $output = '
Por favor selecciona un archivo XML
'; } echo $output;

And the XML file is the following:



    
        393926
        20-11-2019 18:31:18
        2119
        Chalets Update
    
    
        39392de6
        20-12-2019 18:31:18
        aass
        Prueba
    

Cut XML with C # or SQL Server, which is better

Every day, a database creates an XML file with 6 million records. I have to cut them all 200,000 records and paste them into new files. Which way would be more practical in terms of performance and speed? Create a temporary table in SQL Server and from there I will automatically generate the files or process the entire file with a C # program. In both scenarios, I have to do this with C #, since this is a process that a user must do, ie, select the file
Thanks greetings.