CMS 3D CMS Logo

Functions

evf::soaputils Namespace Reference

Functions

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

Function Documentation

xoap::MessageReference evf::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;
    }
xoap::MessageReference evf::soaputils::createFsmSoapResponseMsg ( const string  commandName,
const string  currentState 
)

Definition at line 38 of file SoapUtils.cc.

References alignCSCRings::e, and Exception.

                                           {
        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;
}
string evf::soaputils::extractParameters ( xoap::MessageReference  msg,
xdaq::Application *  app 
)

Collection of utility functions for handling SOAP messages

Author:
aspataru
Revision:
1.1.2.10
Date:
2012/04/21 00:23:00

Extract parameters and FSM command from SOAP message

Definition at line 28 of file SoapUtils.cc.

References edmPickEvents::command.

Referenced by DTGeometryBuilderFromDDD::buildChamber(), DTGeometryBuilderFromDDD::buildLayer(), DTGeometryBuilderFromDDD::buildSuperLayer(), evf::FUResourceBroker::handleFSMSoapMessage(), smproxy::SMProxyServer::handleFSMSoapMessage(), DTGeometryParsFromDD::insertChamber(), DTGeometryParsFromDD::insertLayer(), and DTGeometryParsFromDD::insertSuperLayer().

                                                                         {
        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;
}