Back to index

nordugrid-arc-nox  1.1.0~rc6
SOAPMessage.cpp
Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include <config.h>
00003 #endif
00004 
00005 #include "SOAPMessage.h"
00006 
00007 namespace Arc {
00008 
00009 SOAPMessage::SOAPMessage(long msg_ptr_addr):payload_(NULL) 
00010 {
00011     SOAPMessage *msg = (SOAPMessage *)msg_ptr_addr;
00012     auth_ = msg->Auth();
00013     attributes_ = msg->Attributes();
00014     context_ = msg->Context();
00015     Payload(msg->Payload());
00016 }
00017 
00018 SOAPMessage::SOAPMessage(Message& msg):payload_(NULL)
00019 { 
00020     auth_ = msg.Auth();
00021     attributes_ = msg.Attributes();
00022     context_ = msg.Context();
00023     Payload(dynamic_cast<SOAPEnvelope*>(msg.Payload()));
00024 }
00025 
00026 
00027 SOAPEnvelope* SOAPMessage::Payload(void) {
00028   return payload_;
00029 }
00030 
00031 /* This class is intended to be used in language binding. 
00032  So to make it's usage safe pointers are not used directly.
00033  Instead copy of pointed object is created. */
00034 void SOAPMessage::Payload(SOAPEnvelope* new_payload) {
00035     SOAPEnvelope* p = payload_;
00036     payload_=new_payload?new_payload->New():NULL;
00037     if(p) delete p;
00038 }
00039 
00040 SOAPMessage::~SOAPMessage(void) {
00041     if(payload_) delete payload_;
00042 }
00043 
00044 } // namespace Arc