Back to index

nordugrid-arc-nox  1.1.0~rc6
WSRF.cpp
Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include <config.h>
00003 #endif
00004 
00005 #include <arc/ws-addressing/WSA.h>
00006 #include "WSRF.h"
00007 
00008 namespace Arc {
00009 
00010 void WSRF::set_namespaces(void) {
00011   NS ns;
00012   ns["wsa"]="http://www.w3.org/2005/08/addressing";
00013   ns["wsrf-bf"]="http://docs.oasis-open.org/wsrf/bf-2";
00014   ns["wsrf-r"]="http://docs.oasis-open.org/wsrf/r-2";
00015   ns["wsrf-rw"]="http://docs.oasis-open.org/wsrf/rw-2";
00016   soap_.Namespaces(ns);
00017 }
00018 
00019 WSRF::WSRF(SOAPEnvelope& soap,const std::string& action):
00020              soap_(soap),allocated_(false),valid_(false) {
00021   if(!soap_) return;
00022   set_namespaces();
00023   if(!action.empty()) if(WSAHeader(soap).Action() != action) return;
00024   valid_=true;
00025 }
00026 
00027 
00028 WSRF::WSRF(bool fault,const std::string& action):
00029             soap_(*(new SOAPEnvelope(NS(),fault))),
00030             allocated_(true),valid_(false) {
00031   set_namespaces();
00032   if(!action.empty()) WSAHeader(soap_).Action(action);
00033   valid_=true;
00034 }
00035 
00036 WSRF::~WSRF(void) {
00037   if(allocated_) delete (&soap_);
00038 }
00039 
00040 } // namespace Arc 
00041