/** * 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; }
/** * Creates the extension registry, and sets the defaultSerializer * and defaultDeserializer properties to instances of an * UnknownExtensionSerializer, and an UnknownExtensionDeserializer, * respectively. */ public ExtensionRegistry() { setDefaultSerializer(new UnknownExtensionSerializer()); setDefaultDeserializer(new UnknownExtensionDeserializer()); }
public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { UnknownExtensibilityElement unknownExt = new UnknownExtensibilityElement(); String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); unknownExt.setElementType(elementType); if (requiredStr != null) { unknownExt.setRequired(new Boolean(requiredStr)); } unknownExt.setElement(el); return unknownExt; } }
public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { SOAPAddress soapAddress = (SOAPAddress)extReg.createExtension(parentType, elementType); String locationURI = DOMUtils.getAttribute(el, Constants.ATTR_LOCATION); String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); if (locationURI != null) { soapAddress.setLocationURI(locationURI); } if (requiredStr != null) { soapAddress.setRequired(new Boolean(requiredStr)); } return soapAddress; } }
private void extractWsdlEprs(EndpointInfo endpoint) { //parse the EPR in wsdl List<ExtensibilityElement> portExtensors = endpoint.getExtensors(ExtensibilityElement.class); if (portExtensors != null) { Iterator<ExtensibilityElement> extensionElements = portExtensors.iterator(); QName wsaEpr = new QName(Names.WSA_NAMESPACE_NAME, "EndpointReference"); while (extensionElements.hasNext()) { ExtensibilityElement ext = extensionElements.next(); if (ext instanceof UnknownExtensibilityElement && wsaEpr.equals(ext.getElementType())) { DOMSource domSource = new DOMSource(((UnknownExtensibilityElement)ext).getElement()); W3CEndpointReference w3cEPR = new W3CEndpointReference(domSource); EndpointReferenceType ref = ProviderImpl.convertToInternal(w3cEPR); endpoint.getTarget().setMetadata(ref.getMetadata()); endpoint.getTarget().setReferenceParameters(ref.getReferenceParameters()); endpoint.getTarget().getOtherAttributes().putAll(ref.getOtherAttributes()); } } } }
Boolean required = mimePart.getRequired(); List extensibilityElements = mimePart.getExtensibilityElements(); QName elementType = ext.getElementType(); ExtensionSerializer extSer = extReg.querySerializer(MIMEPart.class, elementType); extSer.marshall(MIMEPart.class, elementType, ext,
throws WSDLException SOAP12Binding soapBinding = (SOAP12Binding)extReg.createExtension(parentType, elementType); String transportURI = DOMUtils.getAttribute(el, soapBinding.setTransportURI(transportURI); soapBinding.setStyle(style); soapBinding.setRequired(new Boolean(requiredStr));
public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { SOAP12Address soapAddress = (SOAP12Address)extReg.createExtension(parentType, elementType); String locationURI = DOMUtils.getAttribute(el, Constants.ATTR_LOCATION); String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); if (locationURI != null) { soapAddress.setLocationURI(locationURI); } if (requiredStr != null) { soapAddress.setRequired(new Boolean(requiredStr)); } return soapAddress; } }
QName elementType = ext.getElementType(); ExtensionRegistry extReg = def.getExtensionRegistry(); if (ext instanceof UnknownExtensibilityElement) extSer = extReg.getDefaultSerializer(); extSer = extReg.querySerializer(parentType,elementType); extSer.marshall(parentType, elementType, ext, pw, def, extReg);
public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { HTTPAddress httpAddress = (HTTPAddress)extReg.createExtension(parentType, elementType); String locationURI = DOMUtils.getAttribute(el, Constants.ATTR_LOCATION); String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); if (locationURI != null) { httpAddress.setLocationURI(locationURI); } if (requiredStr != null) { httpAddress.setRequired(new Boolean(requiredStr)); } return httpAddress; } }
private boolean addressingRequired(List<ExtensibilityElement> exts) { boolean found = false; if (exts != null) { Iterator<ExtensibilityElement> extensionElements = exts.iterator(); while (extensionElements.hasNext() && !found) { ExtensibilityElement ext = extensionElements.next(); if (JAXWSAConstants.WSAW_USINGADDRESSING_QNAME.equals(ext.getElementType()) && ext.getRequired() != null) { return ext.getRequired(); } } } return false; }
public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { UnknownExtensibilityElement unknownExt = (UnknownExtensibilityElement)extension; pw.print(" "); DOM2Writer.serializeAsXML(unknownExt.getElement(), def.getNamespaces(), pw); pw.println(); } }
throws WSDLException MIMEContent mimeContent = (MIMEContent)extReg.createExtension(parentType, elementType); String part = DOMUtils.getAttribute(el, MIMEConstants.ATTR_PART); mimeContent.setPart(part); mimeContent.setType(type); mimeContent.setRequired(new Boolean(requiredStr));
public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { HTTPOperation httpOperation = (HTTPOperation)extReg.createExtension(parentType, elementType); String locationURI = DOMUtils.getAttribute(el, Constants.ATTR_LOCATION); String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); if (locationURI != null) { httpOperation.setLocationURI(locationURI); } if (requiredStr != null) { httpOperation.setRequired(new Boolean(requiredStr)); } return httpOperation; } }
public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { MIMEMimeXml mimeMimeXml = (MIMEMimeXml)extReg.createExtension(parentType, elementType); String part = DOMUtils.getAttribute(el, MIMEConstants.ATTR_PART); String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); if (part != null) { mimeMimeXml.setPart(part); } if (requiredStr != null) { mimeMimeXml.setRequired(new Boolean(requiredStr)); } return mimeMimeXml; } }
public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { HTTPBinding httpBinding = (HTTPBinding)extReg.createExtension(parentType, elementType); String verb = DOMUtils.getAttribute(el, HTTPConstants.ATTR_VERB); String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); if (verb != null) { httpBinding.setVerb(verb); } if (requiredStr != null) { httpBinding.setRequired(new Boolean(requiredStr)); } return httpBinding; } }
private boolean hasUsingAddressing(List<ExtensibilityElement> exts) { boolean found = false; if (exts != null) { Iterator<ExtensibilityElement> extensionElements = exts.iterator(); while (extensionElements.hasNext() && !found) { ExtensibilityElement ext = extensionElements.next(); found = JAXWSAConstants.WSAW_USINGADDRESSING_QNAME.equals(ext.getElementType()); } } return found; } private boolean addressingRequired(List<ExtensibilityElement> exts) {
public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { HTTPUrlReplacement httpUrlReplacement = (HTTPUrlReplacement)extReg.createExtension(parentType, elementType); String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); if (requiredStr != null) { httpUrlReplacement.setRequired(new Boolean(requiredStr)); } return httpUrlReplacement; } }
public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { HTTPUrlEncoded httpUrlEncoded = (HTTPUrlEncoded)extReg.createExtension(parentType, elementType); String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); if (requiredStr != null) { httpUrlEncoded.setRequired(new Boolean(requiredStr)); } return httpUrlEncoded; } }
/** * 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; }