Back to index

nordugrid-arc-nox  1.1.0~rc6
WSA.h
Go to the documentation of this file.
00001 #ifndef __ARC_WSA_H__
00002 #define __ARC_WSA_H__
00003 
00004 #include <arc/XMLNode.h>
00005 #include <arc/message/SOAPEnvelope.h>
00006 
00007 // WS-Adressing
00008 // wsa="http://www.w3.org/2005/08/addressing"
00009 
00010 namespace Arc {
00011 
00012 #define WSA_NAMESPACE "http://www.w3.org/2005/08/addressing"
00013 
00015 
00018 class WSAEndpointReference {
00019  protected:
00020   XMLNode epr_; 
00021  public:
00023   WSAEndpointReference(XMLNode epr);
00025   WSAEndpointReference(const WSAEndpointReference& wsa);
00027   WSAEndpointReference(const std::string& address);
00029   WSAEndpointReference(void);
00031   ~WSAEndpointReference(void);
00033   std::string Address(void) const;
00035   void Address(const std::string& uri);
00037   WSAEndpointReference& operator=(const std::string& address);
00041   XMLNode ReferenceParameters(void);
00045   XMLNode MetaData(void);
00047   operator XMLNode(void);
00048 };
00049 
00051 
00054 class WSAHeader {
00055  protected:
00056   XMLNode header_; 
00057   bool header_allocated_; /* not used */
00058   //XMLNode from_;
00059   //XMLNode to_;
00060   //XMLNode replyto_;
00061   //XMLNode faultto_;
00062  public:
00064   WSAHeader(SOAPEnvelope& soap);
00066   WSAHeader(const std::string& action);
00067   ~WSAHeader(void);
00069   std::string To(void) const;
00071   void To(const std::string& uri);
00074   WSAEndpointReference From(void);
00077   WSAEndpointReference ReplyTo(void);
00080   WSAEndpointReference FaultTo(void);
00082   std::string Action(void) const;
00084   void Action(const std::string& uri);
00086   std::string MessageID(void) const;
00088   void MessageID(const std::string& uri);
00090   std::string RelatesTo(void) const;
00092   void RelatesTo(const std::string& uri);
00094   std::string RelationshipType(void) const;
00096   void RelationshipType(const std::string& uri);
00098   XMLNode ReferenceParameter(int n);
00100   XMLNode ReferenceParameter(const std::string& name);
00103   XMLNode NewReferenceParameter(const std::string& name);
00105   operator XMLNode(void);
00107   static bool Check(SOAPEnvelope& soap);
00108 };
00109 
00111 typedef enum {
00112   WSAFaultNone, 
00113   WSAFaultUnknown, 
00114   WSAFaultInvalidAddressingHeader,
00115   WSAFaultInvalidAddress,
00116   WSAFaultInvalidEPR,
00117   WSAFaultInvalidCardinality,
00118   WSAFaultMissingAddressInEPR,
00119   WSAFaultDuplicateMessageID,
00120   WSAFaultActionMismatch,
00121   WSAFaultOnlyAnonymousAddressSupported,
00122   WSAFaultOnlyNonAnonymousAddressSupported,
00123   WSAFaultMessageAddressingHeaderRequired,
00124   WSAFaultDestinationUnreachable,
00125   WSAFaultActionNotSupported,
00126   WSAFaultEndpointUnavailable
00127 } WSAFault;
00128 
00130 
00131 void WSAFaultAssign(SOAPEnvelope& mesage,WSAFault fid);
00133 
00134 WSAFault WSAFaultExtract(SOAPEnvelope& message);
00135 
00136 } // namespace Arc
00137 
00138 #endif /* __ARC_WSA_H__ */