CMS 3D CMS Logo

Functions

stor::soaputils Namespace Reference

Functions

xoap::MessageReference createFsmSoapResponseMsg (const std::string commandName, const std::string currentState)
std::string extractParameters (xoap::MessageReference, xdaq::Application *)

Function Documentation

xoap::MessageReference stor::soaputils::createFsmSoapResponseMsg ( const std::string  commandName,
const std::string  currentState 
)

Create a SOAP FSM response message

Definition at line 38 of file SoapUtils.cc.

References alignCSCRings::e, and Exception.

Referenced by evf::FUResourceBroker::handleFSMSoapMessage(), stor::StorageManager::handleFSMSoapMessage(), and smproxy::SMProxyServer::handleFSMSoapMessage().

    {
      xoap::MessageReference reply;
      
      try
      {
        // response string
        reply = xoap::createMessage();
        xoap::SOAPEnvelope envelope  = reply->getSOAPPart().getEnvelope();
        xoap::SOAPName responseName  = envelope.createName(commandName+"Response",
          "xdaq",XDAQ_NS_URI);
        xoap::SOAPBodyElement responseElem =
          envelope.getBody().addBodyElement(responseName);
        
        // state string
        xoap::SOAPName stateName = envelope.createName("state", "xdaq",XDAQ_NS_URI);
        xoap::SOAPElement stateElem = responseElem.addChildElement(stateName);
        xoap::SOAPName attributeName = envelope.createName("stateName", "xdaq",XDAQ_NS_URI);
        stateElem.addAttribute(attributeName,currentState);
      }
      catch(xcept::Exception &e)
      {
        XCEPT_RETHROW(xoap::exception::Exception,
          "Failed to create FSM SOAP response message for command '" +
          commandName + "' and current state '" + currentState + "'.",  e);
      }
      
      return reply;
    }
std::string stor::soaputils::extractParameters ( xoap::MessageReference  msg,
xdaq::Application *  app 
)

Collection of utility functions for handling SOAP messages

Author:
mommsen
Revision:
1.4
Date:
2011/03/07 15:31:32

Extract parameters and FSM command from SOAP message

Definition at line 25 of file SoapUtils.cc.

References edmPickEvents::command.

Referenced by stor::StorageManager::handleFSMSoapMessage().

    {
      std::string command;

      // Extract the command name and update any configuration parameter
      // found in the SOAP message in the application infospace
      xdaq2rc::SOAPParameterExtractor soapParameterExtractor(app);
      command = soapParameterExtractor.extractParameters(msg);
      return command;
    }