javax.wsdl.Message.getOrderedParts()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(145)

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

Message.getOrderedParts介绍

[英]Get an ordered list of parts as specified by the partOrder argument.
[中]获取partOrder参数指定的有序零件列表。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

Message in = input.getMessage();
 List<Object> paramOrdering = op.getParameterOrdering();
 List<Part> inParts = in.getOrderedParts( paramOrdering );
if ( output != null ) {
 Message out = output.getMessage();
 List<Part> outParts = out.getOrderedParts( null );

代码示例来源:origin: wsdl4j/wsdl4j

printParts(message.getOrderedParts(null), def, pw);

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

public void visit(Message m, Object parent, WSDLTraversalContext ctx)
{
 if (m != null
  && !messages.containsKey(m)
  && m.getOrderedParts(null) != null)
 {
  Set s = new HashSet();
  Iterator it = m.getOrderedParts(null).iterator();
  while (it.hasNext())
   s.add(((Part) it.next()).getName());
  //messages.put(m.getQName(), s);
  if (s.size() > 0)
  {
   messages.put(m.getQName(), s);
  }
 }
}

代码示例来源:origin: org.fabric3/fabric3-interface-wsdl

@SuppressWarnings("unchecked")
private List<DataType> getFaultTypes(Map faults, XmlSchemaCollection collection, PortType portType, IntrospectionContext context) {
  List<DataType> types = new LinkedList<>();
  for (Fault fault : (Collection<Fault>) faults.values()) {
    Part part = (Part) fault.getMessage().getOrderedParts(null).get(0);
    XSDType dataType = getDataType(part, collection, portType, context);
    if (dataType != null) {
      types.add(dataType);
    }
  }
  return types;
}

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

/**
  * The method extracts part from the message.
  * 
  * @param message a SOAP message.
  * @param part a part name.
  * @return part from the specified message.
  */
 static public Part getPart(Message message, String part)
 {
  Part mesPart = null;
  if (part == null)
   mesPart = (Part) message.getOrderedParts(null).get(0);
  else
   mesPart = message.getPart(part);
  return mesPart;
 }
}

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

public void visit(Message m, Object parent, WSDLTraversalContext ctx)
{
 if (m != null
  && !messages.containsKey(m)
  && m.getOrderedParts(null) != null)
 {
  Set s = new HashSet();
  Iterator it = m.getOrderedParts(null).iterator();
  while (it.hasNext())
   s.add(((Part) it.next()).getName());
  //messages.put(m.getQName(), s);
  if (s.size() > 0)
  {
   messages.put(m.getQName(), s);
  }
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

/**
  * The method extracts part from the message.
  * 
  * @param message a SOAP message.
  * @param part a part name.
  * @return part from the specified message.
  */
 static public Part getPart(Message message, String part)
 {
  Part mesPart = null;
  if (part == null)
   mesPart = (Part) message.getOrderedParts(null).get(0);
  else
   mesPart = message.getPart(part);
  return mesPart;
 }
}

代码示例来源:origin: org.codehaus.service-conduit/sca4j-interface-wsdl

@SuppressWarnings("unchecked")
private List<DataType> getFaultTypes(Map faults, XmlSchemaCollection xmlSchema) {
  
  List<DataType> types = new LinkedList<DataType>();
  
  for(Fault fault : (Collection<Fault>) faults.values()) {
    
    Part part = (Part) fault.getMessage().getOrderedParts(null).get(0);  
    DataType dataType = getDataType(part.getElementName(), xmlSchema);
    if(dataType != null) {
      types.add(dataType);
    }        
    
  }
  
  return types;
  
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-interface-wsdl

private DataType<List<DataType>> getMessageType(Message message) throws InvalidWSDLException {
  List<DataType> partTypes = new ArrayList<DataType>();
  if (message != null) {
    Collection parts = message.getOrderedParts(null);
    for (Object p : parts) {
      WSDLPart part = new WSDLPart((Part)p, Object.class);
      DataType<XMLType> partType = part.getDataType();
      partTypes.add(partType);
    }
  }
  return new DataTypeImpl<List<DataType>>(dataBinding, Object[].class, partTypes);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

private DataType<List<DataType>> getMessageType(Message message) throws InvalidWSDLException {
  List<DataType> partTypes = new ArrayList<DataType>();
  if (message != null) {
    Collection parts = message.getOrderedParts(null);
    for (Object p : parts) {
      WSDLPart part = new WSDLPart((Part)p, Object.class);
      DataType<XMLType> partType = part.getDataType();
      partTypes.add(partType);
    }
  }
  return new DataTypeImpl<List<DataType>>(dataBinding, Object[].class, partTypes);
}

代码示例来源:origin: net.open-esb.core/wsdl

/**
 * Internal helper to extract the information regarding a message
 */
static WSDLInfo prepareInfo(Message wsdlMessageDefinition) {
  WSDLInfo info = new WSDLInfo();
  List msgParts = wsdlMessageDefinition.getOrderedParts(null);
  info.orderedMessageParts = msgParts;
  for (Object msgPart : msgParts) {
    Part currentPart = (Part) msgPart;
    info.partsOrder.add(currentPart.getName());
  }
  info.msgPartCount = info.partsOrder.size();
  info.messageType = wsdlMessageDefinition.getQName();
  cachedInfos.put(wsdlMessageDefinition, info);
  return info;
}

代码示例来源:origin: org.codehaus.service-conduit/sca4j-interface-wsdl

@SuppressWarnings("unchecked")
private List<DataType> getInputType(Input input, XmlSchemaCollection xmlSchema) {
  
  if(input == null) return null;
  
  Message message = input.getMessage();
  List<Part> parts = message.getOrderedParts(null);
  
  List<DataType> types = new LinkedList<DataType>();
  
  for(Part part : parts) {    
    DataType dataType = getDataType(part.getElementName(), xmlSchema);
    if(dataType != null) {
      types.add(dataType);
    }        
  }
  
  return types;
  
}

代码示例来源:origin: org.fabric3/fabric3-interface-wsdl

private DataType getOutputType(Output output, XmlSchemaCollection collection, PortType portType, IntrospectionContext context) {
  if (output == null) {
    // no output type specified (e.g. one-way operation), use void
    return new XSDSimpleType(Void.TYPE, new QName("void"));
  }
  Message message = output.getMessage();
  List parts = message.getOrderedParts(null);
  if (parts.isEmpty()) {
    return getElementDataType(message.getQName(), collection, portType, context);
  } else {
    Part part = (Part) parts.get(0);
    return getDataType(part, collection, portType, context);
  }
}

代码示例来源:origin: org.objectweb.celtix/celtix-rt

public QName getResponseWrapperQName() {
  if (responseWrapperQName == null) {
    if (getSOAPParameterStyle() == SOAPBinding.ParameterStyle.BARE
      || getSOAPStyle() == SOAPBinding.Style.RPC) {
      responseWrapperQName = new QName("", "");
    } else {
      Message msg = getMessage(false);
      if (msg != null) {
        List parts = msg.getOrderedParts(null);
        Part part = (Part)parts.get(0);
        responseWrapperQName = part.getElementName();
      } else {
        responseWrapperQName = new QName("", "");
      }
    }
  }
  return responseWrapperQName;
}

代码示例来源:origin: org.objectweb.celtix/celtix-rt

public QName getRequestWrapperQName() {
  if (requestWrapperQName == null) {
    if (getSOAPParameterStyle() == SOAPBinding.ParameterStyle.BARE
      || getSOAPStyle() == SOAPBinding.Style.RPC) {
      requestWrapperQName = new QName("", "");
    } else {
      Message msg = getMessage(true);
      List parts = msg.getOrderedParts(null);
      Part part = (Part)parts.get(0);
      requestWrapperQName = part.getElementName();
    }
  }
  return requestWrapperQName;
}
public QName getResponseWrapperQName() {

代码示例来源:origin: org.codehaus.service-conduit/sca4j-interface-wsdl

private DataType getOutputType(Output output, XmlSchemaCollection xmlSchema) {
  
  if(output == null) return new XSDElement(null, null);
  
  Message message = output.getMessage();
  Part part = (Part) message.getOrderedParts(null).get(0);
  
  return getDataType(part.getElementName(), xmlSchema);
  
}

代码示例来源:origin: org.apache.servicemix/servicemix-common

private static void checkParts(BindingInput in, SOAPBody soapBody, Message message) {
  if (message.getParts().size() > 1) {
    // use a heuristic to determine which part should be the body
    List<Part> parts = (List<Part>) message.getOrderedParts(null);
    String body = findBody(parts);
    for (Part p : parts) {
      if (body != null && body.equals(p.getName())) {
        soapBody.setParts(Collections.singletonList(body));
      } else {
        SOAPHeaderImpl h = new SOAPHeaderImpl();
        h.setUse("litteral");
        h.setMessage(message.getQName());
        h.setPart(p.getName());
        in.addExtensibilityElement(h);
      }
    }
  }
}

代码示例来源:origin: org.apache.servicemix/servicemix-common

private static void checkParts(BindingOutput out, SOAPBody body, Message message) {
  if (message.getParts().size() > 1) {
    // use a heuristic to determine which part should be the body
    int i = 0;
    for (Part p : (List<Part>) message.getOrderedParts(null)) {
      if (i == 0) {
        body.setParts(Collections.singletonList(p.getName()));
      } else {
        SOAPHeaderImpl h = new SOAPHeaderImpl();
        h.setUse("litteral");
        h.setMessage(message.getQName());
        h.setPart(p.getName());
        out.addExtensibilityElement(h);
      }
      i++;
    }
  }
}

代码示例来源:origin: org.apache.servicemix/servicemix-common

private static void checkParts(BindingInput in, SOAP12Body body, Message message) {
  if (message.getParts().size() > 1) {
    // use a heuristic to determine which part should be the body
    int i = 0;
    for (Part p : (List<Part>) message.getOrderedParts(null)) {
      if (i == 0) {
        body.setParts(Collections.singletonList(p.getName()));
      } else {
        SOAP12HeaderImpl h = new SOAP12HeaderImpl();
        h.setUse("litteral");
        h.setMessage(message.getQName());
        h.setPart(p.getName());
        in.addExtensibilityElement(h);
      }
      i++;
    }
  }
}

代码示例来源:origin: org.apache.servicemix/servicemix-common

private static void checkParts(BindingOutput out, SOAP12Body body, Message message) {
  if (message.getParts().size() > 1) {
    // use a heuristic to determine which part should be the body
    int i = 0;
    for (Part p : (List<Part>) message.getOrderedParts(null)) {
      if (i == 0) {
        body.setParts(Collections.singletonList(p.getName()));
      } else {
        SOAP12HeaderImpl h = new SOAP12HeaderImpl();
        h.setUse("litteral");
        h.setMessage(message.getQName());
        h.setPart(p.getName());
        out.addExtensibilityElement(h);
      }
      i++;
    }
  }
}

相关文章