org.cybergarage.upnp.Action.getService()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.cybergarage.upnp.Action.getService()方法的一些代码示例,展示了Action.getService()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Action.getService()方法的具体详情如下:
包路径:org.cybergarage.upnp.Action
类名称:Action
方法名:getService

Action.getService介绍

暂无

代码示例

代码示例来源:origin: i2p/i2p.i2p

public void setArgumentList(ArgumentList al){
  Node argumentListNode = getActionNode().getNode(ArgumentList.ELEM_NAME);
  if (argumentListNode == null){
    argumentListNode = new Node(ArgumentList.ELEM_NAME);
    getActionNode().addNode(argumentListNode);
  }else{
    argumentListNode.removeAllNodes();
  }
  Iterator<Argument> i = al.iterator();
  while (i.hasNext()) {
    Argument a = i.next();
    a.setService(getService());
    argumentListNode.addNode(a.getArgumentNode());
  }
  
}

代码示例来源:origin: i2p/i2p.i2p

public void setRequest(Action action, ArgumentList argList)
{
  Service service = action.getService();		
  
  setRequestHost(service);
  setEnvelopeNode(SOAP.createEnvelopeBodyNode());
  Node envNode = getEnvelopeNode();
  Node bodyNode = getBodyNode();
  Node argNode = createContentNode(service, action, argList);
  bodyNode.addNode(argNode);
  setContent(envNode);
  String serviceType = service.getServiceType();
  String actionName = action.getName();
  String soapAction = "\"" +
    serviceType +
    "#" + actionName +
    "\"";
  setSOAPAction(soapAction);
}

代码示例来源:origin: i2p/i2p.i2p

private Node createResponseNode(Action action)
{
  String actionName = action.getName();
  Node actionNameResNode = new Node(SOAP.METHODNS + SOAP.DELIM + actionName + SOAP.RESPONSE);
  
  Service service = action.getService();
  if (service != null) {
    actionNameResNode.setAttribute(
      "xmlns:" + SOAP.METHODNS,
        service.getServiceType());
  }
  
  ArgumentList argList = action.getArgumentList();
  int nArgs = argList.size();
  for (int n=0; n<nArgs; n++) {
    Argument arg = argList.getArgument(n);
    if (arg.isOutDirection() == false)
      continue;
    Node argNode = new Node();
    argNode.setName(arg.getName());
    argNode.setValue(arg.getValue());
    actionNameResNode.addNode(argNode);
  }
  
  return actionNameResNode;
}

代码示例来源:origin: cybergarage/cybergarage-upnp

public void setArgumentList(ArgumentList al){
  Node argumentListNode = getActionNode().getNode(ArgumentList.ELEM_NAME);
  if (argumentListNode == null){
    argumentListNode = new Node(ArgumentList.ELEM_NAME);
    getActionNode().addNode(argumentListNode);
  }else{
    argumentListNode.removeAllNodes();
  }
  Iterator i = al.iterator();
  while (i.hasNext()) {
    Argument a = (Argument) i.next();
    a.setService(getService());
    argumentListNode.addNode(a.getArgumentNode());
  }
  
}

代码示例来源:origin: geniusgithub/MediaPlayer

public void setArgumentList(ArgumentList al){
  Node argumentListNode = getActionNode().getNode(ArgumentList.ELEM_NAME);
  if (argumentListNode == null){
    argumentListNode = new Node(ArgumentList.ELEM_NAME);
    getActionNode().addNode(argumentListNode);
  }else{
    argumentListNode.removeAllNodes();
  }
  Iterator i = al.iterator();
  while (i.hasNext()) {
    Argument a = (Argument) i.next();
    a.setService(getService());
    argumentListNode.addNode(a.getArgumentNode());
  }
  
}

代码示例来源:origin: cybergarage/cybergarage-upnp

public void setRequest(Action action, ArgumentList argList)
{
  Service service = action.getService();		
  
  setRequestHost(service);
  setEnvelopeNode(SOAP.createEnvelopeBodyNode());
  Node envNode = getEnvelopeNode();
  Node bodyNode = getBodyNode();
  Node argNode = createContentNode(service, action, argList);
  bodyNode.addNode(argNode);
  setContent(envNode);
  String serviceType = service.getServiceType();
  String actionName = action.getName();
  String soapAction = "\"" +
    serviceType +
    "#" + actionName +
    "\"";
  setSOAPAction(soapAction);
}

代码示例来源:origin: geniusgithub/MediaPlayer

public void setRequest(Action action, ArgumentList argList)
{
  Service service = action.getService();		
  
  setRequestHost(service);
  setEnvelopeNode(SOAP.createEnvelopeBodyNode());
  Node envNode = getEnvelopeNode();
  Node bodyNode = getBodyNode();
  Node argNode = createContentNode(service, action, argList);
  bodyNode.addNode(argNode);
  setContent(envNode);
  String serviceType = service.getServiceType();
  String actionName = action.getName();
  String soapAction = "\"" +
    serviceType +
    "#" + actionName +
    "\"";
  setSOAPAction(soapAction);
}

代码示例来源:origin: cybergarage/cybergarage-upnp

private Node createResponseNode(Action action)
{
  String actionName = action.getName();
  Node actionNameResNode = new Node(SOAP.METHODNS + SOAP.DELIM + actionName + SOAP.RESPONSE);
  
  Service service = action.getService();
  if (service != null) {
    actionNameResNode.setAttribute(
      "xmlns:" + SOAP.METHODNS,
        service.getServiceType());
  }
  
  ArgumentList argList = action.getArgumentList();
  int nArgs = argList.size();
  for (int n=0; n<nArgs; n++) {
    Argument arg = argList.getArgument(n);
    if (arg.isOutDirection() == false)
      continue;
    Node argNode = new Node();
    argNode.setName(arg.getName());
    argNode.setValue(arg.getValue());
    actionNameResNode.addNode(argNode);
  }
  
  return actionNameResNode;
}

代码示例来源:origin: geniusgithub/MediaPlayer

private Node createResponseNode(Action action)
{
  String actionName = action.getName();
  Node actionNameResNode = new Node(SOAP.METHODNS + SOAP.DELIM + actionName + SOAP.RESPONSE);
  
  Service service = action.getService();
  if (service != null) {
    actionNameResNode.setAttribute(
      "xmlns:" + SOAP.METHODNS,
        service.getServiceType());
  }
  
  ArgumentList argList = action.getArgumentList();
  int nArgs = argList.size();
  for (int n=0; n<nArgs; n++) {
    Argument arg = argList.getArgument(n);
    if (arg.isOutDirection() == false)
      continue;
    Node argNode = new Node();
    argNode.setName(arg.getName());
    argNode.setValue(arg.getValue());
    actionNameResNode.addNode(argNode);
  }
  
  return actionNameResNode;
}

相关文章