Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Static Public Member Functions | Protected Attributes
Arc::WSAHeader Class Reference

Interface for manipulation WS-Addressing information in SOAP header. More...

#include <WSA.h>

Collaboration diagram for Arc::WSAHeader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 WSAHeader (SOAPEnvelope &soap)
 Linking to a header of existing SOAP message.
 WSAHeader (const std::string &action)
 Creating independent SOAP header - not implemented.
 ~WSAHeader (void)
std::string To (void) const
 Returns content of To element of SOAP Header.
void To (const std::string &uri)
 Set content of To element of SOAP Header.
WSAEndpointReference From (void)
 Returns From element of SOAP Header.
WSAEndpointReference ReplyTo (void)
 Returns ReplyTo element of SOAP Header.
WSAEndpointReference FaultTo (void)
 Returns FaultTo element of SOAP Header.
std::string Action (void) const
 Returns content of Action element of SOAP Header.
void Action (const std::string &uri)
 Set content of Action element of SOAP Header.
std::string MessageID (void) const
 Returns content of MessageID element of SOAP Header.
void MessageID (const std::string &uri)
 Set content of MessageID element of SOAP Header.
std::string RelatesTo (void) const
 Returns content of RelatesTo element of SOAP Header.
void RelatesTo (const std::string &uri)
 Set content of RelatesTo element of SOAP Header.
std::string RelationshipType (void) const
 Returns content of RelationshipType element of SOAP Header.
void RelationshipType (const std::string &uri)
 Set content of RelationshipType element of SOAP Header.
XMLNode ReferenceParameter (int n)
 Return n-th ReferenceParameter element.
XMLNode ReferenceParameter (const std::string &name)
 Returns first ReferenceParameter element with specified name.
XMLNode NewReferenceParameter (const std::string &name)
 Creates new ReferenceParameter element with specified name.
 operator XMLNode (void)
 Returns reference to SOAP Header - not implemented.

Static Public Member Functions

static bool Check (SOAPEnvelope &soap)
 Tells if specified SOAP message has WSA header.

Protected Attributes

XMLNode header_
bool header_allocated_
 SOAP header element.

Detailed Description

Interface for manipulation WS-Addressing information in SOAP header.

It works on Endpoint Reference stored in XML tree. No information is stored in this object except reference to corresponding XML subtree.

Definition at line 54 of file WSA.h.


Constructor & Destructor Documentation

Arc::WSAHeader::WSAHeader ( SOAPEnvelope &  soap)

Linking to a header of existing SOAP message.

Definition at line 87 of file WSA.cpp.

                                       {
  header_=soap.Header();
  header_allocated_=false;
  // apply predefined namespace prefix
  NS ns;
  ns["wsa"]=WSA_NAMESPACE;
  header_.Namespaces(ns);
} 

Here is the call graph for this function:

Arc::WSAHeader::WSAHeader ( const std::string &  action)

Creating independent SOAP header - not implemented.

Definition at line 96 of file WSA.cpp.

                                     {
}

Definition at line 100 of file WSA.cpp.

                          {
  if(!header_) return;
  // Scan for empty WSA element and remove them from tree
  remove_empty_nodes(header_,"wsa:To");
  remove_empty_nodes(header_,"wsa:From");
  remove_empty_nodes(header_,"wsa:ReplyTo");
  remove_empty_nodes(header_,"wsa:FaultTo");
  remove_empty_nodes(header_,"wsa:MessageID");
  remove_empty_nodes(header_,"wsa:RelatesTo");
  remove_empty_nodes(header_,"wsa:ReferenceParameters");
  remove_empty_nodes(header_,"wsa:Action");
}

Here is the call graph for this function:


Member Function Documentation

std::string Arc::WSAHeader::Action ( void  ) const

Returns content of Action element of SOAP Header.

Definition at line 124 of file WSA.cpp.

                                      {
  return strip_spaces(const_cast<XMLNode&>(header_)["wsa:Action"]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::WSAHeader::Action ( const std::string &  uri)

Set content of Action element of SOAP Header.

If such element does not exist it's created.

Definition at line 129 of file WSA.cpp.

                                           {
  get_node(header_,"wsa:Action")=uri; 
}

Here is the call graph for this function:

bool Arc::WSAHeader::Check ( SOAPEnvelope &  soap) [static]

Tells if specified SOAP message has WSA header.

Definition at line 215 of file WSA.cpp.

                                        {
  if(soap.NamespacePrefix(WSA_NAMESPACE).empty()) return false;
  WSAHeader wsa(soap);
  if(!wsa.header_["wsa:Action"]) return false;
  if(!wsa.header_["wsa:To"]) return false;
  return true;
}

Here is the caller graph for this function:

Returns FaultTo element of SOAP Header.

If such element does not exist it's created. Obtained element may be manipulted.

Definition at line 164 of file WSA.cpp.

                                            {
  return WSAEndpointReference(get_node(header_,"wsa:FaultTo"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Returns From element of SOAP Header.

If such element does not exist it's created. Obtained element may be manipulted.

Definition at line 154 of file WSA.cpp.

                                         {
  return WSAEndpointReference(get_node(header_,"wsa:From"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Arc::WSAHeader::MessageID ( void  ) const

Returns content of MessageID element of SOAP Header.

Definition at line 134 of file WSA.cpp.

                                         {
  return strip_spaces(const_cast<XMLNode&>(header_)["wsa:MessageID"]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::WSAHeader::MessageID ( const std::string &  uri)

Set content of MessageID element of SOAP Header.

If such element does not exist it's created.

Definition at line 139 of file WSA.cpp.

                                              {
  get_node(header_,"wsa:MessageID")=uri; 
}

Here is the call graph for this function:

XMLNode Arc::WSAHeader::NewReferenceParameter ( const std::string &  name)

Creates new ReferenceParameter element with specified name.

Returns reference to created element.

Definition at line 208 of file WSA.cpp.

                                                              {
  XMLNode n = header_.NewChild(name);
  XMLNode a = n.NewAttribute("wsa:IsReferenceParameter");
  a="true";
  return n;
}

Here is the call graph for this function:

Arc::WSAHeader::operator XMLNode ( void  )

Returns reference to SOAP Header - not implemented.

Return n-th ReferenceParameter element.

Definition at line 185 of file WSA.cpp.

                                             {
  for(int i=0;;++i) {
    XMLNode n = header_.Child(i);
    if(!n) return n;
    XMLNode a = n.Attribute("wsa:IsReferenceParameter");
    if(!a) continue;
    if(strcasecmp("true",((std::string)a).c_str()) != 0) continue;
    if((num--) <= 0) return n;
  };
}

Here is the call graph for this function:

Here is the caller graph for this function:

XMLNode Arc::WSAHeader::ReferenceParameter ( const std::string &  name)

Returns first ReferenceParameter element with specified name.

Definition at line 196 of file WSA.cpp.

                                                           {
  XMLNode n_ = header_[name];
  for(int i=0;;++i) {
    XMLNode n = n_[i];
    if(!n) return n;
    XMLNode a = n.Attribute("wsa:IsReferenceParameter");
    if(!a) continue;
    if(strcasecmp("true",((std::string)a).c_str()) != 0) continue;
    return n;
  };
}

Here is the call graph for this function:

std::string Arc::WSAHeader::RelatesTo ( void  ) const

Returns content of RelatesTo element of SOAP Header.

Definition at line 144 of file WSA.cpp.

                                         {
  return strip_spaces(const_cast<XMLNode&>(header_)["wsa:RelatesTo"]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::WSAHeader::RelatesTo ( const std::string &  uri)

Set content of RelatesTo element of SOAP Header.

If such element does not exist it's created.

Definition at line 149 of file WSA.cpp.

                                              {
  get_node(header_,"wsa:RelatesTo")=uri; 
}

Here is the call graph for this function:

std::string Arc::WSAHeader::RelationshipType ( void  ) const

Returns content of RelationshipType element of SOAP Header.

Definition at line 168 of file WSA.cpp.

                                                {
  return strip_spaces(const_cast<XMLNode&>(header_)["wsa:ReplyTo"].Attribute("wsa:RelationshipType"));
}

Here is the call graph for this function:

void Arc::WSAHeader::RelationshipType ( const std::string &  uri)

Set content of RelationshipType element of SOAP Header.

If such element does not exist it's created.

Definition at line 173 of file WSA.cpp.

                                                     {
  XMLNode n = get_node(header_,"wsa:ReplyTo");
  XMLNode a = n.Attribute("wsa:RelationshipType");
  if(!a) a=n.NewAttribute("wsa:RelationshipType");
  a=uri;
}

Here is the call graph for this function:

Returns ReplyTo element of SOAP Header.

If such element does not exist it's created. Obtained element may be manipulted.

Definition at line 159 of file WSA.cpp.

                                            {
  return WSAEndpointReference(get_node(header_,"wsa:ReplyTo"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Arc::WSAHeader::To ( void  ) const

Returns content of To element of SOAP Header.

Definition at line 114 of file WSA.cpp.

                                  {
  return strip_spaces(const_cast<XMLNode&>(header_)["wsa:To"]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::WSAHeader::To ( const std::string &  uri)

Set content of To element of SOAP Header.

If such element does not exist it's created.

Definition at line 119 of file WSA.cpp.

                                       {
  get_node(header_,"wsa:To")=uri; 
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 56 of file WSA.h.

SOAP header element.

Definition at line 57 of file WSA.h.


The documentation for this class was generated from the following files: