Axiom
  1. Axiom
  2. AXIOM-136

bug in axiom-api class StAXOMBuilder n the method processNamespaceData, generating wrong namespace.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Invalid
    • Affects Version/s: 1.2.8
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Linux Ubuntu

      Description

      In class StAXOMBuilder found an error in the method processNamespaceData. The command if (namespaceURI! = Null & & namespaceURI.length ()> 0) is wrong, should be so if (namespaceURIFromParser! = Null & & namespaceURIFromParser.length ()> 0). This error is generating wrong namespace for the tags.

        Activity

        Hide
        Andreas Veithen added a comment -

        Can you provide a test case or test this with a more recent version of Axiom/Axis2?

        Show
        Andreas Veithen added a comment - Can you provide a test case or test this with a more recent version of Axiom/Axis2?
        Hide
        Italivio Correa added a comment -

        I'm using the latest version of the axiom-api-1.2.8. In this version by
        modifying the XML sent by the client, ie the namespace. I made the changes
        you suggested, and went on to work correctly, or not to modify the namespace
        in the XML sent by the customers. So I suggested this fix, so I can take the
        AXIS in the development of web services we are doing.

        2010/1/16 Andreas Veithen (JIRA) <jira@apache.org>

        Show
        Italivio Correa added a comment - I'm using the latest version of the axiom-api-1.2.8. In this version by modifying the XML sent by the client, ie the namespace. I made the changes you suggested, and went on to work correctly, or not to modify the namespace in the XML sent by the customers. So I suggested this fix, so I can take the AXIS in the development of web services we are doing. 2010/1/16 Andreas Veithen (JIRA) <jira@apache.org>
        Hide
        Andreas Veithen added a comment -

        Sorry, but I don't understand your last comment. Does it mean that by replacing Axiom with a more recent version the problem disappears?

        Show
        Andreas Veithen added a comment - Sorry, but I don't understand your last comment. Does it mean that by replacing Axiom with a more recent version the problem disappears?
        Hide
        Italivio Correa added a comment -

        Andreas, sorry my English is limited. But I'm using the latest version of
        Axiom (1.2.8). This version is what is the problem. I made the suggested
        change in class StAXOMBuilder and recompiled and it worked. I wish this
        change was included in the next version of AXIOM. If you want I can send the
        class with the modification that I made.

        2010/1/17 Andreas Veithen (JIRA) <jira@apache.org>

        Show
        Italivio Correa added a comment - Andreas, sorry my English is limited. But I'm using the latest version of Axiom (1.2.8). This version is what is the problem. I made the suggested change in class StAXOMBuilder and recompiled and it worked. I wish this change was included in the next version of AXIOM. If you want I can send the class with the modification that I made. 2010/1/17 Andreas Veithen (JIRA) <jira@apache.org>
        Hide
        Italivio Correa added a comment -

        I'm not using the framework AXIS2, but the SPRING-WS factory configured as
        message AXIOM. I use the jars AXIOM-API and AXIOM-IMPL version 1.2.8.

        2010/1/18 Italivio Correa (JIRA) <jira@apache.org>

        Show
        Italivio Correa added a comment - I'm not using the framework AXIS2, but the SPRING-WS factory configured as message AXIOM. I use the jars AXIOM-API and AXIOM-IMPL version 1.2.8. 2010/1/18 Italivio Correa (JIRA) <jira@apache.org>
        Hide
        Andreas Veithen added a comment -

        Can you provide a sample that reproduces the problem?

        Show
        Andreas Veithen added a comment - Can you provide a sample that reproduces the problem?
        Hide
        Italivio Correa added a comment -

        It is only the SOAP message, or should I send a sample project?

        2010/1/18 Andreas Veithen (JIRA) <jira@apache.org>

        Show
        Italivio Correa added a comment - It is only the SOAP message, or should I send a sample project? 2010/1/18 Andreas Veithen (JIRA) <jira@apache.org>
        Hide
        Italivio Correa added a comment -

        Andreas,

        Here's an example of a message sent by customers. Note the namespaces, they
        can not modified. In version 1.2.8 of the AXIOM API, he repeats the
        namespaces in child tags. Making the change suggested he begins to read
        correctly the namespaces, as sent by the client. Note, the schema validation
        will be performed later.
        <?xml version="1.0" encoding="UTF-8" ?>
        <soap12:envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <soap12:Header>
        <nfeCabecMsg xmlns="http://www.teste.inf.br/nfe/wsdl/NfeRecepcao2">
        <versaoDados>2.00</versaoDados>
        <cUF>50</cUF>
        </nfeCabecMsg>
        </soap12:Header>
        <soap12:Body>
        <nfeRecepcaoLote2 xmlns="
        http://www.teste.inf.br/nfe/wsdl/NfeRecepcao2">
        <nfeDadosMsg>
        <soap12iNFe xmlns="http://www.teste.inf.br/nfe"
        versao="1.10">
        <idLote>55000000000053</idLote>
        <NFe xmlns="http://www.teste.inf.br/nfe">
        <infNFe versao="1.10"
        Id="NFe50100136810786000150550000000000534732561370">
        <ide>
        <cUF>50</cUF>
        <cNF>473256137</cNF>
        <natOp>VENDA</natOp>
        <indPag>1</indPag>
        <mod>55</mod>
        <serie>0</serie>
        <nNF>53</nNF>
        <procEmi>0</procEmi>
        <verProc>System 1.0</verProc>
        </ide>
        <emit>
        <CNPJ>00000000000000</CNPJ>
        <xNome>KITS SHOPP LTDA</xNome>
        <xFant>KITS SHOPP LTDA</xFant>
        <enderEmit>
        <xLgr>RUA SEI LA, 3333</xLgr>
        <nro>0</nro>
        <xBairro>JARDIM PAULISTA</xBairro>
        <cMun>5002704</cMun>
        <xMun>CAMPO GRANDE</xMun>
        <UF>MS</UF>
        </enderEmit>
        <IE>000000000</IE>
        </emit>
        <dest>
        <CPF>00000000000</CPF>
        <xNome>TESTE TESTETESTETETETETE</xNome>
        <enderDest>
        <xLgr>RUA PORTUGAL, 333</xLgr>
        <nro>1373</nro>
        <xBairro>N.S. DE FATIMA</xBairro>
        <cMun>5002704</cMun>
        <xMun>CAMPO GRANDE</xMun>
        <UF>MS</UF>
        </enderDest>
        <IE>ISENTO</IE>
        </dest>
        </infNFe>
        </NFe>
        <NFe xmlns="http://www.teste.inf.br/nfe">
        <infNFe versao="1.10"
        Id="NFe50100136810786000150550000000000534732561371">
        <ide>
        <cUF>50</cUF>
        <cNF>473256138</cNF>
        <natOp>VENDA</natOp>
        <indPag>1</indPag>
        <mod>55</mod>
        <serie>0</serie>
        <nNF>53</nNF>
        <procEmi>0</procEmi>
        <verProc>System 1.0</verProc>
        </ide>
        <emit>
        <CNPJ>00000000000000</CNPJ>
        <xNome>KITS SHOPP LTDA</xNome>
        <xFant>KITS SHOPP LTDA</xFant>
        <enderEmit>
        <xLgr>RUA SEI LA, 3333</xLgr>
        <nro>0</nro>
        <xBairro>JARDIM PAULISTA</xBairro>
        <cMun>5002704</cMun>
        <xMun>CAMPO GRANDE</xMun>
        <UF>MS</UF>
        </enderEmit>
        <IE>000000000</IE>
        </emit>
        <dest>
        <CPF>00000000000</CPF>
        <xNome>TESTE TESTETESTETETETETE</xNome>
        <enderDest>
        <xLgr>RUA PORTUGAL, 333</xLgr>
        <nro>1373</nro>
        <xBairro>N.S. DE FATIMA</xBairro>
        <cMun>5002704</cMun>
        <xMun>CAMPO GRANDE</xMun>
        <UF>MS</UF>
        </enderDest>
        <IE>ISENTO</IE>
        </dest>
        </infNFe>
        </NFe>
        </soap12iNFe>
        </nfeDadosMsg>
        </nfeRecepcaoLote2>
        </soap12:Body>
        </soap12:envelope>

        2010/1/18 Italivio Correa (JIRA) <jira@apache.org>

        Show
        Italivio Correa added a comment - Andreas, Here's an example of a message sent by customers. Note the namespaces, they can not modified. In version 1.2.8 of the AXIOM API, he repeats the namespaces in child tags. Making the change suggested he begins to read correctly the namespaces, as sent by the client. Note, the schema validation will be performed later. <?xml version="1.0" encoding="UTF-8" ?> <soap12:envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap12:Header> <nfeCabecMsg xmlns="http://www.teste.inf.br/nfe/wsdl/NfeRecepcao2"> <versaoDados>2.00</versaoDados> <cUF>50</cUF> </nfeCabecMsg> </soap12:Header> <soap12:Body> <nfeRecepcaoLote2 xmlns=" http://www.teste.inf.br/nfe/wsdl/NfeRecepcao2 "> <nfeDadosMsg> <soap12iNFe xmlns="http://www.teste.inf.br/nfe" versao="1.10"> <idLote>55000000000053</idLote> <NFe xmlns="http://www.teste.inf.br/nfe"> <infNFe versao="1.10" Id="NFe50100136810786000150550000000000534732561370"> <ide> <cUF>50</cUF> <cNF>473256137</cNF> <natOp>VENDA</natOp> <indPag>1</indPag> <mod>55</mod> <serie>0</serie> <nNF>53</nNF> <procEmi>0</procEmi> <verProc>System 1.0</verProc> </ide> <emit> <CNPJ>00000000000000</CNPJ> <xNome>KITS SHOPP LTDA</xNome> <xFant>KITS SHOPP LTDA</xFant> <enderEmit> <xLgr>RUA SEI LA, 3333</xLgr> <nro>0</nro> <xBairro>JARDIM PAULISTA</xBairro> <cMun>5002704</cMun> <xMun>CAMPO GRANDE</xMun> <UF>MS</UF> </enderEmit> <IE>000000000</IE> </emit> <dest> <CPF>00000000000</CPF> <xNome>TESTE TESTETESTETETETETE</xNome> <enderDest> <xLgr>RUA PORTUGAL, 333</xLgr> <nro>1373</nro> <xBairro>N.S. DE FATIMA</xBairro> <cMun>5002704</cMun> <xMun>CAMPO GRANDE</xMun> <UF>MS</UF> </enderDest> <IE>ISENTO</IE> </dest> </infNFe> </NFe> <NFe xmlns="http://www.teste.inf.br/nfe"> <infNFe versao="1.10" Id="NFe50100136810786000150550000000000534732561371"> <ide> <cUF>50</cUF> <cNF>473256138</cNF> <natOp>VENDA</natOp> <indPag>1</indPag> <mod>55</mod> <serie>0</serie> <nNF>53</nNF> <procEmi>0</procEmi> <verProc>System 1.0</verProc> </ide> <emit> <CNPJ>00000000000000</CNPJ> <xNome>KITS SHOPP LTDA</xNome> <xFant>KITS SHOPP LTDA</xFant> <enderEmit> <xLgr>RUA SEI LA, 3333</xLgr> <nro>0</nro> <xBairro>JARDIM PAULISTA</xBairro> <cMun>5002704</cMun> <xMun>CAMPO GRANDE</xMun> <UF>MS</UF> </enderEmit> <IE>000000000</IE> </emit> <dest> <CPF>00000000000</CPF> <xNome>TESTE TESTETESTETETETETE</xNome> <enderDest> <xLgr>RUA PORTUGAL, 333</xLgr> <nro>1373</nro> <xBairro>N.S. DE FATIMA</xBairro> <cMun>5002704</cMun> <xMun>CAMPO GRANDE</xMun> <UF>MS</UF> </enderDest> <IE>ISENTO</IE> </dest> </infNFe> </NFe> </soap12iNFe> </nfeDadosMsg> </nfeRecepcaoLote2> </soap12:Body> </soap12:envelope> 2010/1/18 Italivio Correa (JIRA) <jira@apache.org>
        Hide
        Andreas Veithen added a comment -

        Please send some code that can be readily executed and that clearly shows the problem.

        Show
        Andreas Veithen added a comment - Please send some code that can be readily executed and that clearly shows the problem.
        Hide
        Italivio Correa added a comment -

        Andreas

        Attached is a sample application with the original lib axiom-api. It was
        developed in netbeans 6.8. I am also sending a sample message-soap that in
        the example-message-soap.txt. The axim lib-1.2.8-api-api new.jar is that you
        have modified to check the difference in the message generated. Currently
        I'm testing on glassfish-v3 and tomcat-6. I'm using spring-ws version 1.5.8,
        it will find the dependencies (jar) required.

        2010/1/18 Andreas Veithen (JIRA) <jira@apache.org>

        Show
        Italivio Correa added a comment - Andreas Attached is a sample application with the original lib axiom-api. It was developed in netbeans 6.8. I am also sending a sample message-soap that in the example-message-soap.txt. The axim lib-1.2.8-api-api new.jar is that you have modified to check the difference in the message generated. Currently I'm testing on glassfish-v3 and tomcat-6. I'm using spring-ws version 1.5.8, it will find the dependencies (jar) required. 2010/1/18 Andreas Veithen (JIRA) <jira@apache.org>
        Hide
        Italivio Correa added a comment -

        Andreas

        Attached is a sample application with the original lib axiom-api. It was
        developed in netbeans 6.8. I am also sending a sample message-soap that in
        the example-message-soap.txt. The axim lib-1.2.8-api-api new.jar is that you
        have modified to check the difference in the message generated. Currently
        I'm testing on glassfish-v3 and tomcat-6. I'm using spring-ws version 1.5.8,
        it will find the dependencies (jar) required.

        2010/1/18 Andreas Veithen (JIRA) <jira@apache.org>

        Show
        Italivio Correa added a comment - Andreas Attached is a sample application with the original lib axiom-api. It was developed in netbeans 6.8. I am also sending a sample message-soap that in the example-message-soap.txt. The axim lib-1.2.8-api-api new.jar is that you have modified to check the difference in the message generated. Currently I'm testing on glassfish-v3 and tomcat-6. I'm using spring-ws version 1.5.8, it will find the dependencies (jar) required. 2010/1/18 Andreas Veithen (JIRA) <jira@apache.org>
        Hide
        Andreas Veithen added a comment -

        The ZIP doesn't contain any NetBeans files and it is not recognized by NetBeans. Please provide a self-contained project based on Maven, Eclipse, NetBeans or Ant.

        Show
        Andreas Veithen added a comment - The ZIP doesn't contain any NetBeans files and it is not recognized by NetBeans. Please provide a self-contained project based on Maven, Eclipse, NetBeans or Ant.
        Hide
        Andreas Veithen added a comment -

        Marking this issue as invalid. Reasons:

        • The reporter failed to provide the necessary input to reproduce the problem.
        • The suggested change would badly break namespace handling: since namespaceURIFromParser is used inside a loop to store the URI of the namespace declaration being processed, it would actually set the namespace of the element based on the last namespace declaration on the element.
        • It is extremely unlikely that StAXOMBuilder#processNamespaceData has a bug that went unnoticed until now.
        Show
        Andreas Veithen added a comment - Marking this issue as invalid. Reasons: The reporter failed to provide the necessary input to reproduce the problem. The suggested change would badly break namespace handling: since namespaceURIFromParser is used inside a loop to store the URI of the namespace declaration being processed, it would actually set the namespace of the element based on the last namespace declaration on the element. It is extremely unlikely that StAXOMBuilder#processNamespaceData has a bug that went unnoticed until now.

          People

          • Assignee:
            Unassigned
            Reporter:
            Italivio Correa
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development