Code example for QName

Methods: sleep

0
    public OMElement sleepOperation(OMElement param) throws AxisFault {
 
        param.build();
        param.detach();
 
        OMElement timeElement = param.getFirstChildWithName(new QName("load"));
        String time = timeElement.getText();
        try { 
            Thread.sleep(Long.parseLong(time));
        } catch (InterruptedException e) {
            throw new AxisFault("Service is interrupted while sleeping."); 
        } 
 
        String sName = System.getProperty("server_name");
        if (sName != null) {
            timeElement.setText("Response from server: " + sName);
        } else { 
            timeElement.setText("Response from anonymous server");
        } 
        return param;
    }