package wei_chih.message.noncap;

import message.SOAPMessage;
import org.w3c.dom.NodeList;

/**
 *
 * @author Scott
 */
public class Acknowledgement extends SOAPMessage {

    private static final long serialVersionUID = 20141006L;
    private final String result;

    public Acknowledgement(String result) {
        super("acknowledgement");

        this.result = result;

        add2Body("result", result);
    }

    private Acknowledgement(javax.xml.soap.SOAPMessage message) {
        super(message);

        NodeList body = getBody();

        this.result = body.item(0).getTextContent();
    }

    public String getResult() {
        return result;
    }

    public static Acknowledgement parse(String receive) {
        return new Acknowledgement(SOAPMessage.parseSOAP(receive));
    }
}
