

package reversoResponse;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;


/**
 * <p>Clase Java para anonymous complex type.
 * 
 * <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
 * 
 * <pre>
 * &lt;complexType>
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="SignonRs">
 *           &lt;complexType>
 *             &lt;complexContent>
 *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 &lt;sequence>
 *                   &lt;element name="CustId">
 *                     &lt;complexType>
 *                       &lt;complexContent>
 *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                           &lt;sequence>
 *                             &lt;element name="CustLoginId" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                           &lt;/sequence>
 *                         &lt;/restriction>
 *                       &lt;/complexContent>
 *                     &lt;/complexType>
 *                   &lt;/element>
 *                   &lt;element name="ServerDt" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                   &lt;element name="ClientDt" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                 &lt;/sequence>
 *               &lt;/restriction>
 *             &lt;/complexContent>
 *           &lt;/complexType>
 *         &lt;/element>
 *         &lt;element name="PmtRevRs">
 *           &lt;complexType>
 *             &lt;complexContent>
 *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 &lt;sequence>
 *                   &lt;element name="PmtAddRs">
 *                     &lt;complexType>
 *                       &lt;complexContent>
 *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                           &lt;sequence>
 *                             &lt;element name="Status">
 *                               &lt;complexType>
 *                                 &lt;complexContent>
 *                                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                                     &lt;sequence>
 *                                       &lt;element name="ServerStatusCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                                       &lt;element name="Severity" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                                       &lt;element name="StatusDesc" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                                     &lt;/sequence>
 *                                   &lt;/restriction>
 *                                 &lt;/complexContent>
 *                               &lt;/complexType>
 *                             &lt;/element>
 *                           &lt;/sequence>
 *                         &lt;/restriction>
 *                       &lt;/complexContent>
 *                     &lt;/complexType>
 *                   &lt;/element>
 *                   &lt;element name="RqUID" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                   &lt;element name="CSPRefId" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                 &lt;/sequence>
 *               &lt;/restriction>
 *             &lt;/complexContent>
 *           &lt;/complexType>
 *         &lt;/element>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "signonRs",
    "pmtRevRs"
})
@XmlRootElement(name = "IFX")
public class IFX {

    @XmlElement(name = "SignonRs", required = true)
    protected IFX.SignonRs signonRs;
    @XmlElement(name = "PmtRevRs", required = true)
    protected IFX.PmtRevRs pmtRevRs;

    /**
     * Obtiene el valor de la propiedad signonRs.
     * 
     * @return
     *     possible object is
     *     {@link IFX.SignonRs }
     *     
     */
    
    
         public IFX() {

        this.setSignonRs(new SignonRs());
    }

    public Document string2DOM(String s) {
        Document tmpX = null;
        DocumentBuilder builder = null;
        try {
            builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
        } catch (javax.xml.parsers.ParserConfigurationException error) {
            int coderror = 10;
            String msgerror = "Error crando factory String2DOM " + error.getMessage();
            System.out.println(msgerror);
            return null;
        }
        try {
            tmpX = (Document) builder.parse(new ByteArrayInputStream(s.getBytes()));
        } catch (org.xml.sax.SAXException error) {
            int coderror = 10;
            String msgerror = "Error parseo SAX String2DOM " + error.getMessage();
            System.out.println(msgerror);
            return null;
        } catch (IOException error) {
            int coderror = 10;
            String msgerror = "Error generando Bytes String2DOM " + error.getMessage();
            System.out.println(msgerror);
            return null;
        }
        return tmpX;
    }
    String name = "";

    public void leerNodos(Element docEle) {
        NodeList hijos = docEle.getChildNodes();

        for (int i = 0; i < hijos.getLength(); i++) {
            Node nodo = hijos.item(i);

            if (nodo instanceof Element) {

                name = nodo.getNodeName();

                if (nodo.hasChildNodes()) {
                    leerNodos((Element) nodo);
                }
            } else {
                if (nodo.getTextContent().trim().length() > 0) {
                    System.out.println(name + "= " + nodo.getTextContent());
                    try {
                        datos.put(name, nodo.getTextContent());
                    } catch (Exception e) {
                        //e.printStackTrace();
                    }
                }
            }
        }
    }
    
    HashMap datos = new HashMap();

    public IFX(String xml) {

        System.out.println("-------------->OUT");

        Document doc = string2DOM(xml);
        Element docEle = doc.getDocumentElement();

        this.leerNodos(docEle);
        Iterator it = datos.entrySet().iterator();

        while (it.hasNext()) {
            Map.Entry e = (Map.Entry) it.next();
            System.out.println(e.getKey() + " - " + e.getValue());
        }
        
        
      this.signonRs = new SignonRs();
        
      this.signonRs.setCustId(new reversoResponse.IFX.SignonRs.CustId());
      this.signonRs.custId.setCustLoginId(datos.get("CustLoginId").toString());
      this.signonRs.setServerDt(datos.get("ServerDt").toString());

      this.pmtRevRs = new PmtRevRs();
              
      this.pmtRevRs.setPmtAddRs(new reversoResponse.IFX.PmtRevRs.PmtAddRs());
//      this.pmtRevRs.setRqUID(datos.get("RqUID").toString());
//      this.pmtRevRs.setCSPRefId(datos.get("CSPRefId").toString());
      
      this.pmtRevRs.pmtAddRs.setStatus(new reversoResponse.IFX.PmtRevRs.PmtAddRs.Status());
      this.pmtRevRs.pmtAddRs.status.setServerStatusCode(datos.get("StatusCode").toString());
      this.pmtRevRs.pmtAddRs.status.setSeverity(datos.get("Severity").toString());
      this.pmtRevRs.pmtAddRs.status.setStatusDesc(datos.get("StatusDesc").toString());
      
      
      
      
      
        
    }

    public IFX.SignonRs getSignonRs() {
        return signonRs;
    }

    /**
     * Define el valor de la propiedad signonRs.
     * 
     * @param value
     *     allowed object is
     *     {@link IFX.SignonRs }
     *     
     */
    public void setSignonRs(IFX.SignonRs value) {
        this.signonRs = value;
    }

    /**
     * Obtiene el valor de la propiedad pmtRevRs.
     * 
     * @return
     *     possible object is
     *     {@link IFX.PmtRevRs }
     *     
     */
    public IFX.PmtRevRs getPmtRevRs() {
        return pmtRevRs;
    }

    /**
     * Define el valor de la propiedad pmtRevRs.
     * 
     * @param value
     *     allowed object is
     *     {@link IFX.PmtRevRs }
     *     
     */
    public void setPmtRevRs(IFX.PmtRevRs value) {
        this.pmtRevRs = value;
    }


    /**
     * <p>Clase Java para anonymous complex type.
     * 
     * <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;complexContent>
     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       &lt;sequence>
     *         &lt;element name="PmtAddRs">
     *           &lt;complexType>
     *             &lt;complexContent>
     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *                 &lt;sequence>
     *                   &lt;element name="Status">
     *                     &lt;complexType>
     *                       &lt;complexContent>
     *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *                           &lt;sequence>
     *                             &lt;element name="ServerStatusCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
     *                             &lt;element name="Severity" type="{http://www.w3.org/2001/XMLSchema}string"/>
     *                             &lt;element name="StatusDesc" type="{http://www.w3.org/2001/XMLSchema}string"/>
     *                           &lt;/sequence>
     *                         &lt;/restriction>
     *                       &lt;/complexContent>
     *                     &lt;/complexType>
     *                   &lt;/element>
     *                 &lt;/sequence>
     *               &lt;/restriction>
     *             &lt;/complexContent>
     *           &lt;/complexType>
     *         &lt;/element>
     *         &lt;element name="RqUID" type="{http://www.w3.org/2001/XMLSchema}string"/>
     *         &lt;element name="CSPRefId" type="{http://www.w3.org/2001/XMLSchema}string"/>
     *       &lt;/sequence>
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "pmtAddRs",
        "rqUID",
        "cspRefId"
    })
    public static class PmtRevRs {

        @XmlElement(name = "PmtAddRs", required = true)
        protected IFX.PmtRevRs.PmtAddRs pmtAddRs;
        @XmlElement(name = "RqUID", required = true)
        protected String rqUID;
        @XmlElement(name = "CSPRefId", required = true)
        protected String cspRefId;

        /**
         * Obtiene el valor de la propiedad pmtAddRs.
         * 
         * @return
         *     possible object is
         *     {@link IFX.PmtRevRs.PmtAddRs }
         *     
         */
        public IFX.PmtRevRs.PmtAddRs getPmtAddRs() {
            return pmtAddRs;
        }

        /**
         * Define el valor de la propiedad pmtAddRs.
         * 
         * @param value
         *     allowed object is
         *     {@link IFX.PmtRevRs.PmtAddRs }
         *     
         */
        public void setPmtAddRs(IFX.PmtRevRs.PmtAddRs value) {
            this.pmtAddRs = value;
        }

        /**
         * Obtiene el valor de la propiedad rqUID.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getRqUID() {
            return rqUID;
        }

        /**
         * Define el valor de la propiedad rqUID.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setRqUID(String value) {
            this.rqUID = value;
        }

        /**
         * Obtiene el valor de la propiedad cspRefId.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getCSPRefId() {
            return cspRefId;
        }

        /**
         * Define el valor de la propiedad cspRefId.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setCSPRefId(String value) {
            this.cspRefId = value;
        }


        /**
         * <p>Clase Java para anonymous complex type.
         * 
         * <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
         * 
         * <pre>
         * &lt;complexType>
         *   &lt;complexContent>
         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
         *       &lt;sequence>
         *         &lt;element name="Status">
         *           &lt;complexType>
         *             &lt;complexContent>
         *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
         *                 &lt;sequence>
         *                   &lt;element name="ServerStatusCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
         *                   &lt;element name="Severity" type="{http://www.w3.org/2001/XMLSchema}string"/>
         *                   &lt;element name="StatusDesc" type="{http://www.w3.org/2001/XMLSchema}string"/>
         *                 &lt;/sequence>
         *               &lt;/restriction>
         *             &lt;/complexContent>
         *           &lt;/complexType>
         *         &lt;/element>
         *       &lt;/sequence>
         *     &lt;/restriction>
         *   &lt;/complexContent>
         * &lt;/complexType>
         * </pre>
         * 
         * 
         */
        @XmlAccessorType(XmlAccessType.FIELD)
        @XmlType(name = "", propOrder = {
            "status"
        })
        public static class PmtAddRs {

            @XmlElement(name = "Status", required = true)
            protected IFX.PmtRevRs.PmtAddRs.Status status;

            /**
             * Obtiene el valor de la propiedad status.
             * 
             * @return
             *     possible object is
             *     {@link IFX.PmtRevRs.PmtAddRs.Status }
             *     
             */
            public IFX.PmtRevRs.PmtAddRs.Status getStatus() {
                return status;
            }

            /**
             * Define el valor de la propiedad status.
             * 
             * @param value
             *     allowed object is
             *     {@link IFX.PmtRevRs.PmtAddRs.Status }
             *     
             */
            public void setStatus(IFX.PmtRevRs.PmtAddRs.Status value) {
                this.status = value;
            }


            /**
             * <p>Clase Java para anonymous complex type.
             * 
             * <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
             * 
             * <pre>
             * &lt;complexType>
             *   &lt;complexContent>
             *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
             *       &lt;sequence>
             *         &lt;element name="ServerStatusCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
             *         &lt;element name="Severity" type="{http://www.w3.org/2001/XMLSchema}string"/>
             *         &lt;element name="StatusDesc" type="{http://www.w3.org/2001/XMLSchema}string"/>
             *       &lt;/sequence>
             *     &lt;/restriction>
             *   &lt;/complexContent>
             * &lt;/complexType>
             * </pre>
             * 
             * 
             */
            @XmlAccessorType(XmlAccessType.FIELD)
            @XmlType(name = "", propOrder = {
                "serverStatusCode",
                "severity",
                "statusDesc"
            })
            public static class Status {

                @XmlElement(name = "ServerStatusCode", required = true)
                protected String serverStatusCode;
                @XmlElement(name = "Severity", required = true)
                protected String severity;
                @XmlElement(name = "StatusDesc", required = true)
                protected String statusDesc;

                /**
                 * Obtiene el valor de la propiedad serverStatusCode.
                 * 
                 * @return
                 *     possible object is
                 *     {@link String }
                 *     
                 */
                public String getServerStatusCode() {
                    return serverStatusCode;
                }

                /**
                 * Define el valor de la propiedad serverStatusCode.
                 * 
                 * @param value
                 *     allowed object is
                 *     {@link String }
                 *     
                 */
                public void setServerStatusCode(String value) {
                    this.serverStatusCode = value;
                }

                /**
                 * Obtiene el valor de la propiedad severity.
                 * 
                 * @return
                 *     possible object is
                 *     {@link String }
                 *     
                 */
                public String getSeverity() {
                    return severity;
                }

                /**
                 * Define el valor de la propiedad severity.
                 * 
                 * @param value
                 *     allowed object is
                 *     {@link String }
                 *     
                 */
                public void setSeverity(String value) {
                    this.severity = value;
                }

                /**
                 * Obtiene el valor de la propiedad statusDesc.
                 * 
                 * @return
                 *     possible object is
                 *     {@link String }
                 *     
                 */
                public String getStatusDesc() {
                    return statusDesc;
                }

                /**
                 * Define el valor de la propiedad statusDesc.
                 * 
                 * @param value
                 *     allowed object is
                 *     {@link String }
                 *     
                 */
                public void setStatusDesc(String value) {
                    this.statusDesc = value;
                }

            }

        }

    }


    /**
     * <p>Clase Java para anonymous complex type.
     * 
     * <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;complexContent>
     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       &lt;sequence>
     *         &lt;element name="CustId">
     *           &lt;complexType>
     *             &lt;complexContent>
     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *                 &lt;sequence>
     *                   &lt;element name="CustLoginId" type="{http://www.w3.org/2001/XMLSchema}string"/>
     *                 &lt;/sequence>
     *               &lt;/restriction>
     *             &lt;/complexContent>
     *           &lt;/complexType>
     *         &lt;/element>
     *         &lt;element name="ServerDt" type="{http://www.w3.org/2001/XMLSchema}string"/>
     *         &lt;element name="ClientDt" type="{http://www.w3.org/2001/XMLSchema}string"/>
     *       &lt;/sequence>
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "custId",
        "serverDt",
        "clientDt"
    })
    public static class SignonRs {

        @XmlElement(name = "CustId", required = true)
        protected IFX.SignonRs.CustId custId;
        @XmlElement(name = "ServerDt", required = true)
        protected String serverDt;
        @XmlElement(name = "ClientDt", required = true)
        protected String clientDt;

        /**
         * Obtiene el valor de la propiedad custId.
         * 
         * @return
         *     possible object is
         *     {@link IFX.SignonRs.CustId }
         *     
         */
        public IFX.SignonRs.CustId getCustId() {
            return custId;
        }

        /**
         * Define el valor de la propiedad custId.
         * 
         * @param value
         *     allowed object is
         *     {@link IFX.SignonRs.CustId }
         *     
         */
        public void setCustId(IFX.SignonRs.CustId value) {
            this.custId = value;
        }

        /**
         * Obtiene el valor de la propiedad serverDt.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getServerDt() {
            return serverDt;
        }

        /**
         * Define el valor de la propiedad serverDt.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setServerDt(String value) {
            this.serverDt = value;
        }

        /**
         * Obtiene el valor de la propiedad clientDt.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getClientDt() {
            return clientDt;
        }

        /**
         * Define el valor de la propiedad clientDt.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setClientDt(String value) {
            this.clientDt = value;
        }


        /**
         * <p>Clase Java para anonymous complex type.
         * 
         * <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
         * 
         * <pre>
         * &lt;complexType>
         *   &lt;complexContent>
         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
         *       &lt;sequence>
         *         &lt;element name="CustLoginId" type="{http://www.w3.org/2001/XMLSchema}string"/>
         *       &lt;/sequence>
         *     &lt;/restriction>
         *   &lt;/complexContent>
         * &lt;/complexType>
         * </pre>
         * 
         * 
         */
        @XmlAccessorType(XmlAccessType.FIELD)
        @XmlType(name = "", propOrder = {
            "custLoginId"
        })
        public static class CustId {

            @XmlElement(name = "CustLoginId", required = true)
            protected String custLoginId;

            /**
             * Obtiene el valor de la propiedad custLoginId.
             * 
             * @return
             *     possible object is
             *     {@link String }
             *     
             */
            public String getCustLoginId() {
                return custLoginId;
            }

            /**
             * Define el valor de la propiedad custLoginId.
             * 
             * @param value
             *     allowed object is
             *     {@link String }
             *     
             */
            public void setCustLoginId(String value) {
                this.custLoginId = value;
            }

        }

    }

}
