CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 edm::hlt::Exception.

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

42  {
43  xoap::MessageReference reply;
44 
45  try
46  {
47  // response string
48  reply = xoap::createMessage();
49  xoap::SOAPEnvelope envelope = reply->getSOAPPart().getEnvelope();
50  xoap::SOAPName responseName = envelope.createName(commandName+"Response",
51  "xdaq",XDAQ_NS_URI);
52  xoap::SOAPBodyElement responseElem =
53  envelope.getBody().addBodyElement(responseName);
54 
55  // state string
56  xoap::SOAPName stateName = envelope.createName("state", "xdaq",XDAQ_NS_URI);
57  xoap::SOAPElement stateElem = responseElem.addChildElement(stateName);
58  xoap::SOAPName attributeName = envelope.createName("stateName", "xdaq",XDAQ_NS_URI);
59  stateElem.addAttribute(attributeName,currentState);
60  }
61  catch(xcept::Exception &e)
62  {
63  XCEPT_RETHROW(xoap::exception::Exception,
64  "Failed to create FSM SOAP response message for command '" +
65  commandName + "' and current state '" + currentState + "'.", e);
66  }
67 
68  return reply;
69  }
xoap::MessageReference evf::soaputils::createFsmSoapResponseMsg ( const string  commandName,
const string  currentState 
)

Definition at line 38 of file SoapUtils.cc.

References alignCSCRings::e, and edm::hlt::Exception.

39  {
40  xoap::MessageReference reply;
41 
42  try {
43  // response string
44  reply = xoap::createMessage();
45  xoap::SOAPEnvelope envelope = reply->getSOAPPart().getEnvelope();
46  xoap::SOAPName responseName = envelope.createName(
47  commandName + "Response", "xdaq", XDAQ_NS_URI);
48  xoap::SOAPBodyElement responseElem = envelope.getBody().addBodyElement(
49  responseName);
50 
51  // state string
52  xoap::SOAPName stateName = envelope.createName("state", "xdaq",
53  XDAQ_NS_URI);
54  xoap::SOAPElement stateElem = responseElem.addChildElement(stateName);
55  xoap::SOAPName attributeName = envelope.createName("stateName", "xdaq",
56  XDAQ_NS_URI);
57  stateElem.addAttribute(attributeName, currentState);
58  } catch (xcept::Exception &e) {
59  XCEPT_RETHROW(
61  "Failed to create FSM SOAP response message for command '"
62  + commandName + "' and current state '" + currentState
63  + "'.", e);
64  }
65 
66  return reply;
67 }
string evf::soaputils::extractParameters ( xoap::MessageReference  msg,
xdaq::Application *  app 
)

Collection of utility functions for handling SOAP messages

Author:
aspataru
Revision:
1.3
Date:
2012/05/03 09:37:30

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(), DTGeometryParsFromDD::insertChamber(), DTGeometryParsFromDD::insertLayer(), and DTGeometryParsFromDD::insertSuperLayer().

28  {
29  string command;
30 
31  // Extract the command name and update any configuration parameter
32  // found in the SOAP message in the application infospace
33  xdaq2rc::SOAPParameterExtractor soapParameterExtractor(app);
34  command = soapParameterExtractor.extractParameters(msg);
35  return command;
36 }