1 package org.apache.axis2.services; 2 3 import org.apache.axis2.om.OMAbstractFactory; 4 import org.apache.axis2.om.OMNode; 5 import org.apache.axis2.soap.SOAPEnvelope; 6 import org.apache.axis2.soap.SOAPFactory; 7 import org.apache.commons.logging.Log; 8 import org.apache.commons.logging.LogFactory; 9 10 import java.util.Date ; 11 12 18 19 public class OutService extends Thread { 20 protected Log log = LogFactory.getLog(getClass()); 21 22 public void run() { 23 while(true){ 24 sentOutMessage(); 25 } 26 } 27 28 private void sentOutMessage() { 29 SOAPFactory omFactory = OMAbstractFactory.getSOAP11Factory(); 30 SOAPEnvelope env = omFactory.getDefaultEnvelope(); 31 OMNode testNode = omFactory.createText("This is auto generated messge by the server at " + new Date ()); 32 env.getBody().addChild(testNode); 33 log.info("Generated Message" + env.getBody().getFirstChild()); 34 35 59 } 60 } 61 | Popular Tags |