package axis2;

import org.apache.ws.commons.om.OMAbstractFactory;
import org.apache.ws.commons.om.OMElement;
import org.apache.ws.commons.om.OMFactory;
import org.apache.ws.commons.om.OMNamespace;

public class XmlEchoSoapImpl {
    static XmlEcho theEcho;

    public OMElement echoString(OMElement in) {
        if (theEcho == null)
            theEcho = new XmlEcho();
        String echoedString = theEcho.echoString(in.getFirstElement().getText());
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace("http://hdayservice.result.com", "result");
        OMElement retElement = fac.createOMElement("return", omNs);
        OMElement valueElement = fac.createOMElement("value", omNs);
        valueElement.setText(echoedString);
        retElement.addChild(valueElement);
        return retElement;
    }

   public static void main(String[] args) {

   }
}
