protected void setIsDocumentStyle() { if (binding == null) { if (userSpecifiedWSDLDefinition != null && userSpecifiedWSDLDefinition.getDefinition() != null) { Message firstMessage = (Message)userSpecifiedWSDLDefinition.getDefinition().getMessages().values().iterator().next(); Part firstPart = (Part)firstMessage.getParts().values().iterator().next(); if (firstPart.getTypeName() != null) { isDocumentStyle = false; return; } } // default to document style isDocumentStyle = true; return; } else { for (Object ext : binding.getExtensibilityElements()) { if (ext instanceof SOAPBinding) { isDocumentStyle = !"rpc".equals(((SOAPBinding)ext).getStyle()); return; } } isDocumentStyle = true; return; } }
protected void setIsDocumentStyle() { if (binding == null) { if (userSpecifiedWSDLDefinition != null && userSpecifiedWSDLDefinition.getDefinition() != null) { Message firstMessage = (Message)userSpecifiedWSDLDefinition.getDefinition().getMessages().values().iterator().next(); Part firstPart = (Part)firstMessage.getParts().values().iterator().next(); if (firstPart.getTypeName() != null) { isDocumentStyle = false; return; } } // default to document style isDocumentStyle = true; return; } else { for (Object ext : binding.getExtensibilityElements()) { if (ext instanceof SOAPBinding) { isDocumentStyle = !"rpc".equals(((SOAPBinding)ext).getStyle()); return; } } isDocumentStyle = true; return; } }
Definition definition = wsdlDefinition.getDefinition(); WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter(); String baseURI = null; outStream.write(baseURI.getBytes()); outStream.write(separator); writer.writeWSDL(importedWSDLDefintion.getDefinition(), outStream);
/** * Get all the WSDL definitions referenced through the import statements of the BPEL process * @param theImports - a list of the import statements * @return - a Set containing all the referenced WSDL definitions */ private Set<Definition> getImportedWSDLDefinitions( List<BPELImportElement> theImports, ModelResolver resolver, ProcessorContext context ) { Set<Definition> wsdlDefinitions = null; for (BPELImportElement theImport : theImports) { if (theImport.getImportType().equals(BPELProcessorConstants.WSDL_NS)) { // If the Import is a WSDL import, resolve the WSDL WSDLDefinition theWSDL = resolveWSDLDefinition( theImport.getLocation(), theImport.getNamespace(), resolver, context ); if( theWSDL != null ) { theImport.setWSDLDefinition( theWSDL ); // Find all the WSDL definitions matching the imported namespace if( wsdlDefinitions == null ) { wsdlDefinitions = new HashSet<Definition>(); } // end if wsdlDefinitions.add(theWSDL.getDefinition()); } // end if } // end if } // end for return wsdlDefinitions; } // end getImportedWSDLDefinitions
/** * Get all the WSDL definitions referenced through the import statements of the BPEL process * @param theImports - a list of the import statements * @return - a Set containing all the referenced WSDL definitions */ private Set<Definition> getImportedWSDLDefinitions( List<BPELImportElement> theImports, ModelResolver resolver, ProcessorContext context ) { Set<Definition> wsdlDefinitions = null; for (BPELImportElement theImport : theImports) { if (theImport.getImportType().equals(BPELProcessorConstants.WSDL_NS)) { // If the Import is a WSDL import, resolve the WSDL WSDLDefinition theWSDL = resolveWSDLDefinition( theImport.getLocation(), theImport.getNamespace(), resolver, context ); if( theWSDL != null ) { theImport.setWSDLDefinition( theWSDL ); // Find all the WSDL definitions matching the imported namespace if( wsdlDefinitions == null ) { wsdlDefinitions = new HashSet<Definition>(); } // end if wsdlDefinitions.add(theWSDL.getDefinition()); } // end if } // end if } // end for return wsdlDefinitions; } // end getImportedWSDLDefinitions
/** * Return the WSDL Definition for a given PortType * @param portTypeName - the QName of the PortType */ public Definition getDefinitionForPortType( QName portTypeName ) { //System.out.println("getDefinitionForPortType called for portType: " + portTypeName ); // Find the named PortType in the list of WSDL interfaces associated with this BPEL Process Collection<WSDLInterface> theInterfaces = implementation.getProcessDefinition().getInterfaces(); for( WSDLInterface wsdlInterface : theInterfaces ) { if ( wsdlInterface.getPortType().getQName().equals( portTypeName ) ) { // Extract and return the Definition associated with the WSDLDefinition... return wsdlInterface.getWsdlDefinition().getDefinition(); } // end if } // end for return null; } // end getDefinitionforPortType
private static WSDLDefinition findDefinition(WSDLDefinition wsdlDef, QName name, Class type) { if (wsdlDef == null || name == null) { return wsdlDef; } if (wsdlDef.getURI() != null) { // not a facade Definition def = wsdlDef.getDefinition(); Map types = type == PortType.class ? def.getPortTypes() : def.getBindings(); if (types.get(name) != null) { return wsdlDef; } } for (WSDLDefinition impDef : wsdlDef.getImportedDefinitions()) { WSDLDefinition d = findDefinition(impDef, name, type); if (d != null) { return d; } } return null; }
private static WSDLDefinition findDefinition(WSDLDefinition wsdlDef, QName name, Class type) { if (wsdlDef == null || name == null) { return wsdlDef; } if (wsdlDef.getURI() != null) { // not a facade Definition def = wsdlDef.getDefinition(); Map types = type == PortType.class ? def.getPortTypes() : def.getBindings(); if (types.get(name) != null) { return wsdlDef; } } for (WSDLDefinition impDef : wsdlDef.getImportedDefinitions()) { WSDLDefinition d = findDefinition(impDef, name, type); if (d != null) { return d; } } return null; }
if (unresolved.getDefinition() == null && unresolved.getLocation() != null) { try { resolved = aggregate(list, context); if (unresolved.getNamespace().equals(resolved.getDefinition().getTargetNamespace())) { resolved.setNamespace(resolved.getDefinition().getTargetNamespace()); resolved.setUnresolved(false); resolved.setURI(unresolved.getURI()); if (unresolved.getNamespace().equals(namespace)) { WSDLDefinition wsdlDefinition = (WSDLDefinition)artifact.getModel(); if (wsdlDefinition.getDefinition() == null) { loadDefinition(wsdlDefinition, context);
if (unresolved.getDefinition() == null && unresolved.getLocation() != null) { try { resolved = aggregate(list, context); if (unresolved.getNamespace().equals(resolved.getDefinition().getTargetNamespace())) { resolved.setNamespace(resolved.getDefinition().getTargetNamespace()); resolved.setUnresolved(false); resolved.setURI(unresolved.getURI()); if (unresolved.getNamespace().equals(namespace)) { WSDLDefinition wsdlDefinition = (WSDLDefinition)artifact.getModel(); if (wsdlDefinition.getDefinition() == null) { loadDefinition(wsdlDefinition, context);
if (d.getDefinition() != null) { javax.wsdl.Import imp = facade.createImport(); imp.setNamespaceURI(d.getNamespace()); imp.setDefinition(d.getDefinition()); imp.setLocationURI(d.getDefinition().getDocumentBaseURI()); facade.addImport(imp); List<ExtensibilityElement> extElements = (List<ExtensibilityElement>) d.getDefinition().getExtensibilityElements(); for( ExtensibilityElement extElement : extElements ) { facade.addExtensibilityElement(extElement);
private static boolean addImport(QName name, Class type, WSDLDefinition wsdlDef, Definition newDef, List<WSDLDefinition> imports) { String namespace = name.getNamespaceURI(); if (newDef.getImports(namespace) == null) { WSDLDefinition impDef = findDefinition(wsdlDef, name, type); if (impDef != null) { Import imp = newDef.createImport(); imp.setNamespaceURI(namespace); imp.setLocationURI(impDef.getURI().toString()); imp.setDefinition(impDef.getDefinition()); newDef.addNamespace("ns" + imports.size(), namespace); newDef.addImport(imp); imports.add(impDef); return true; } else { // import was not added because element not found return false; } } return true; }
private static boolean addImport(QName name, Class type, WSDLDefinition wsdlDef, Definition newDef, List<WSDLDefinition> imports) { String namespace = name.getNamespaceURI(); if (newDef.getImports(namespace) == null) { WSDLDefinition impDef = findDefinition(wsdlDef, name, type); if (impDef != null) { Import imp = newDef.createImport(); imp.setNamespaceURI(namespace); imp.setLocationURI(impDef.getURI().toString()); imp.setDefinition(impDef.getDefinition()); newDef.addNamespace("ns" + imports.size(), namespace); newDef.addImport(imp); imports.add(impDef); return true; } else { // import was not added because element not found return false; } } return true; }
wsdlDefinitions.add(theWSDL.getDefinition()); for (WSDLDefinition importedWSDL: theWSDL.getImportedDefinitions()) { wsdlDefinitions.add(importedWSDL.getDefinition());
String targetNamespace = wsBinding.getUserSpecifiedWSDLDefinition().getDefinition().getTargetNamespace(); try { WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter(); writer.writeWSDL(wsBinding.getUserSpecifiedWSDLDefinition().getDefinition(), outStream); } catch (Exception ex){ ex.printStackTrace();
String targetNamespace = wsBinding.getUserSpecifiedWSDLDefinition().getDefinition().getTargetNamespace(); try { WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter(); writer.writeWSDL(wsBinding.getUserSpecifiedWSDLDefinition().getDefinition(), outStream); } catch (Exception ex){ ex.printStackTrace();
if ( d.getDefinition() == definition ) { XmlSchemaElement element = d.getXmlSchemaElement(name); if ( element != null )
if ( d.getDefinition() == definition ) { XmlSchemaElement element = d.getXmlSchemaElement(name); if ( element != null )
if ( d.getDefinition() == definition ) { XmlSchemaType type = d.getXmlSchemaType(name); if ( type != null )
if ( d.getDefinition() == definition ) { XmlSchemaType type = d.getXmlSchemaType(name); if ( type != null )