Go to the documentation of this file.00001
00009 #include "EventFilter/ResourceBroker/interface/SoapUtils.h"
00010
00011 #include "xdaq/NamespaceURI.h"
00012 #include "xoap/MessageFactory.h"
00013 #include "xoap/Method.h"
00014 #include "xoap/SOAPBody.h"
00015 #include "xoap/SOAPEnvelope.h"
00016 #include "xoap/SOAPName.h"
00017 #include "xoap/SOAPPart.h"
00018 #include "xoap/domutils.h"
00019
00020 #include "xdaq2rc/version.h"
00021 #include "xdaq2rc/SOAPParameterExtractor.hh"
00022
00023 using std::string;
00024
00025 namespace evf {
00026 namespace soaputils {
00027
00028 string extractParameters(xoap::MessageReference msg, xdaq::Application* app) {
00029 string command;
00030
00031
00032
00033 xdaq2rc::SOAPParameterExtractor soapParameterExtractor(app);
00034 command = soapParameterExtractor.extractParameters(msg);
00035 return command;
00036 }
00037
00038 xoap::MessageReference createFsmSoapResponseMsg(const string commandName,
00039 const string currentState) {
00040 xoap::MessageReference reply;
00041
00042 try {
00043
00044 reply = xoap::createMessage();
00045 xoap::SOAPEnvelope envelope = reply->getSOAPPart().getEnvelope();
00046 xoap::SOAPName responseName = envelope.createName(
00047 commandName + "Response", "xdaq", XDAQ_NS_URI);
00048 xoap::SOAPBodyElement responseElem = envelope.getBody().addBodyElement(
00049 responseName);
00050
00051
00052 xoap::SOAPName stateName = envelope.createName("state", "xdaq",
00053 XDAQ_NS_URI);
00054 xoap::SOAPElement stateElem = responseElem.addChildElement(stateName);
00055 xoap::SOAPName attributeName = envelope.createName("stateName", "xdaq",
00056 XDAQ_NS_URI);
00057 stateElem.addAttribute(attributeName, currentState);
00058 } catch (xcept::Exception &e) {
00059 XCEPT_RETHROW(
00060 xoap::exception::Exception,
00061 "Failed to create FSM SOAP response message for command '"
00062 + commandName + "' and current state '" + currentState
00063 + "'.", e);
00064 }
00065
00066 return reply;
00067 }
00068
00069 }
00070
00071 }