Esempio n. 1
0
Service *Action::getService() {
  CyberXML::Node *node = getServiceNode();
  ServiceData *data = (ServiceData *)node->getUserData();
  if (data == NULL)
    return NULL;
  return data->getService();
}
CyberXML::Node *ActionRequest::getActionNode() {
  CyberXML::Node *bodyNode = getBodyNode();
  if (bodyNode == NULL)
    return NULL;
  if (bodyNode->hasNodes() == false)
    return NULL;
  return bodyNode->getNode(0);
}
const char *ActionRequest::getActionName(std::string &buf) {
  CyberXML::Node *node = getActionNode();
  if (node == NULL)
    return "";
  const char *name = node->getName();
  if (name == NULL)
    return "";
  uHTTP::String nameStr(name);
  int idx = nameStr.indexOf(CyberSOAP::SOAP::DELIM)+1;
  if (idx < 0)
    return "";
  uHTTP::String actName;
  buf = nameStr.substring(idx, nameStr.length(), actName);
  return buf.c_str();
}
Esempio n. 4
0
void Action::initArgumentList() {
  argumentList = new ArgumentList(true);
  argumentInList = new ArgumentList(false);
  argumentOutList = new ArgumentList(false);

  CyberXML::Node *serviceNode = getServiceNode();
  CyberXML::Node *argumentListNode = getActionNode()->getNode(ArgumentList::ELEM_NAME);
  if (serviceNode == NULL || argumentListNode == NULL)
    return;

  int nodeCnt = argumentListNode->getNNodes();
  for (int n = 0; n < nodeCnt; n++) {
    CyberXML::Node *argNode = argumentListNode->getNode(n);
    if (Argument::isArgumentNode(argNode) == false)
      continue;
    Argument *arg = new Argument(serviceNode, argNode);
    argumentList->add(arg);
    if (arg->isInDirection() == true) 
      argumentInList->add(arg);
    if (arg->isOutDirection() == true)
      argumentOutList->add(arg);
  } 
}