/** * Find all of the extensibility elements with the specified name. * * @param extensibleElement * WSDL type which extends ElementExtensible. * @param elementType * Name of the extensibility element to find. * @return List of ExtensibilityElements, may be empty. */ @SuppressWarnings( "unchecked" ) protected static List<ExtensibilityElement> findExtensibilityElements( ElementExtensible extensibleElement, String elementType ) { List<ExtensibilityElement> elements = new ArrayList<ExtensibilityElement>(); List<ExtensibilityElement> extensibilityElements = extensibleElement.getExtensibilityElements(); if ( extensibilityElements != null ) { for ( ExtensibilityElement element : extensibilityElements ) { if ( element.getElementType().getLocalPart().equalsIgnoreCase( elementType ) ) { elements.add( element ); } } } return elements; }
/** * Find the specified extensibility element, if more than one with the specified name exists in the list, return the * first one found. * * @param extensibleElement * WSDL type which extends ElementExtensible. * @param elementType * Name of the extensiblity element to find. * @return ExtensibilityElement The ExtensiblityElement, if not found return null. */ @SuppressWarnings( "unchecked" ) protected static ExtensibilityElement findExtensibilityElement( ElementExtensible extensibleElement, String elementType ) { List<ExtensibilityElement> extensibilityElements = extensibleElement.getExtensibilityElements(); if ( extensibilityElements != null ) { for ( ExtensibilityElement element : extensibilityElements ) { if ( element.getElementType().getLocalPart().equalsIgnoreCase( elementType ) ) { return element; } } } return null; }
private SOAPBody getSoapBody(ElementExtensible bindingInput) { List<?> extensibilityElements= bindingInput.getExtensibilityElements(); for (Object supposedSOAPBody : extensibilityElements) { if (supposedSOAPBody instanceof SOAPBody) { return ((SOAPBody) supposedSOAPBody); } } return null; }
public static <T> T getExtension(ElementExtensible element, Class<T> format) { if (element != null) { for (Iterator it = element.getExtensibilityElements().iterator(); it.hasNext();) { Object ex = it.next(); if (format.isInstance(ex)) { return format.cast(ex); } } } return null; }
public static <T> List<T> getExtensions(ElementExtensible element, Class<T> format) { List<T> l = new ArrayList<T>(); if (element != null) { for (Iterator it = element.getExtensibilityElements().iterator(); it.hasNext();) { Object ex = it.next(); if (format.isInstance(ex)) { l.add(format.cast(ex)); } } } return l; }
@SuppressWarnings("unchecked") public static List<SOAPHeader> getSOAPHeaders(ElementExtensible eee) { return CollectionsX.filter(new ArrayList<SOAPHeader>(), (Collection<Object>) eee.getExtensibilityElements(), SOAPHeader.class); }
@SuppressWarnings("unchecked") public static List<javax.wsdl.extensions.soap.SOAPHeader> getSOAPHeaders( final ElementExtensible eee) { return CollectionsX.filter(new ArrayList<javax.wsdl.extensions.soap.SOAPHeader>(), (Collection<Object>) eee.getExtensibilityElements(), javax.wsdl.extensions.soap.SOAPHeader.class); } }
public static <T> T getFirstExtensibilityElement(final ElementExtensible parent, final Class<T> cls) { Collection<T> ee = CollectionsX.filter(parent.getExtensibilityElements(), cls); return ee.isEmpty() ? null : ee.iterator().next(); }
/** * Method getSoapBody. * * @param bindingInput a BindingInput object. * @return body. * @throws WSIException if problems occur during processing. */ protected SOAPBody getSoapBody(BindingInput bindingInput) throws WSIException { SOAPBody soapBody = null; Iterator extensibles = bindingInput.getExtensibilityElements().iterator(); while (extensibles.hasNext()) { Object extensible = extensibles.next(); if (extensible instanceof SOAPBody) { soapBody = (SOAPBody) extensible; break; } } return soapBody; }
private void processUnknownExtensibilityElements(ElementExtensible src, Extendable dest) throws WSDLException { List extElements = src.getExtensibilityElements(); for (int i = 0; i < extElements.size(); i++) { ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(i); if (extElement instanceof UnknownExtensibilityElement) { UnknownExtensibilityElement uee = (UnknownExtensibilityElement)extElement; processNotUnderstoodExtesibilityElement(uee, dest); } } }
public static <T> T getFirstExtensibilityElement(ElementExtensible parent, Class<T> cls) { Collection<T> ee = CollectionsX.filter(parent.getExtensibilityElements(), cls); return ee.isEmpty() ? null : ee.iterator().next(); }
private String getSOAPBindingStyle(Binding binding) { String style = null; List list = binding.getExtensibilityElements(); for (int i = 0; i < list.size(); i++) { if (list.get(i) instanceof SOAPBinding) { style = ((SOAPBinding) list.get(i)).getStyle(); break; } } if (style == null) style = WSIConstants.ATTRVAL_SOAP_BIND_STYLE_DOC; return style; }
/** * Returns Multipart related bindings, if does not found, returns null. * @param op binding operation * @return Multipart related bindings, if does not found, returns null. */ private MIMEMultipartRelated getMultipartRelatedBindings( BindingOperation op) { // Finding operation extensibility elems // in the binding depending on message type List extElems = op.getBindingOutput().getExtensibilityElements(); // check list on first element if((extElems == null) || (extElems.size() == 0) || !(extElems.get(0) instanceof MIMEMultipartRelated)) return null; return (MIMEMultipartRelated) extElems.get(0); } }
/** * Ensure that the Types element is correct. * * @param wsdlDefinition The definitions element from the current document. */ protected void validateTypes(Definition wsdlDefinition, IWSDL11ValidationInfo valInfo) { Types types = wsdlDefinition.getTypes(); // ensure that types is defined if (types != null) { List parents = new Vector(); parents.add(wsdlDefinition); parents.add(0, types); validateExtensibilityElementList(parents, types.getExtensibilityElements(), valInfo); parents.remove(0); } }
/** * Internal method processes WSDL types. * @param types WSDL types. * @param context a context. */ private void processTypes(Types types, String context) { if (types == null) return; List exts = types.getExtensibilityElements(); if (exts != null) { Iterator it = exts.iterator(); while (it.hasNext()) { ExtensibilityElement el = (ExtensibilityElement) it.next(); if (el instanceof Schema) searchForSchema( ((Schema) el).getElement(), context); } } }
private boolean checkRpcLiteral(BindingOperation oper, Binding binding) { List list = oper.getExtensibilityElements(); SOAPOperation sop = getSOAPOperation(list); if (sop == null) return false; String style = (sop.getStyle() == null ? getSOAPBindingStyle(binding) : sop.getStyle()); if (!style.equals(WSIConstants.ATTRVAL_SOAP_BIND_STYLE_RPC)) return false; list = oper.getBindingOutput().getExtensibilityElements(); SOAPBody body = getSOAPBody(list); if (body == null) return false; String use = body.getUse(); if (use == null) return false; return use.equals(WSIConstants.ATTRVAL_SOAP_BODY_USE_LIT); }
/** * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.IWSDL11Validator#validate(java.lang.Object, java.util.List, org.eclipse.wsdl.validate.wsdl11.IWSDL11ValidationInfo) */ public void validate(Object element, List parents, IWSDL11ValidationInfo valInfo) { Definition wsdlDefinition = (Definition)element; validateTypes(wsdlDefinition, valInfo); validateServices(wsdlDefinition, valInfo); validateBindings(wsdlDefinition, valInfo); validatePortTypes(wsdlDefinition, valInfo); validateMessages(wsdlDefinition, valInfo); // The parents list is expected to be empty here, so simply add the definition // being validated to the parents list, validate its extensibility elements, // then remove it. parents.add(wsdlDefinition); validateExtensibilityElementList(parents, wsdlDefinition.getExtensibilityElements(), valInfo); parents.remove(0); }
private void copyExtensors(AbstractPropertiesHolder info, ElementExtensible extElement, BindingOperationInfo bop) { if (info != null) { for (ExtensibilityElement ext : cast(extElement.getExtensibilityElements(), ExtensibilityElement.class)) { info.addExtensor(ext); if (bop != null && extElement instanceof BindingInput) { addMessageFromBinding(ext, bop, true); } if (bop != null && extElement instanceof BindingOutput) { addMessageFromBinding(ext, bop, false); } } } }
private void copyExtensors(AbstractPropertiesHolder info, ElementExtensible extElement, BindingOperationInfo bop) { if (info != null) { for (ExtensibilityElement ext : cast(extElement.getExtensibilityElements(), ExtensibilityElement.class)) { info.addExtensor(ext); if (bop != null && extElement instanceof BindingInput) { addMessageFromBinding(ext, bop, true); } if (bop != null && extElement instanceof BindingOutput) { addMessageFromBinding(ext, bop, false); } } } }
private void copyExtensors(AbstractPropertiesHolder info, ElementExtensible extElement, BindingOperationInfo bop) { if (info != null) { for (ExtensibilityElement ext : cast(extElement.getExtensibilityElements(), ExtensibilityElement.class)) { info.addExtensor(ext); if (bop != null && extElement instanceof BindingInput) { addMessageFromBinding(ext, bop, true); } if (bop != null && extElement instanceof BindingOutput) { addMessageFromBinding(ext, bop, false); } } } }