Package javax.wsdl

Examples of javax.wsdl.Import


    {
        boolean importIsRedundant = false;
        Iterator importIter = imports.iterator();
        while ( importIter.hasNext() )
        {
            Import anotherImport = (Import) importIter.next();
            if ( WsdlUtils.equals( anImport, anotherImport ) )
            {
                importIsRedundant = true;
                break;
            }
View Full Code Here


        if (null != wsdlImports && !wsdlImports.isEmpty()){
            Collection importsCollection = wsdlImports.values();
            for (Iterator iterator = importsCollection.iterator(); iterator.hasNext();) {
                Vector values = (Vector)iterator.next();
                for (int i = 0; i < values.size(); i++) {
                    Import wsdlImport = (Import)values.elementAt(i);

                    if (wsdlImport.getDefinition()!=null){
                        Definition importedDef = wsdlImport.getDefinition();
                        if (importedDef!=null){
                            processImports(importedDef);

                            //copy types
                            Types t = importedDef.getTypes();
View Full Code Here

         {
            List l = (List)imports.next();
            Iterator importsByNS = l.iterator();
            while (importsByNS.hasNext())
            {
               Import anImport = (Import)importsByNS.next();
               wsdlOneOnePort = modifySOAPAddress(anImport.getNamespaceURI(), portQName, serviceEndpointURL, anImport.getDefinition().getServices());
            }
         }
      }

      // if it still doesn't exist something is wrong
View Full Code Here

            }
        }
        for (Iterator iter = definition.getImports().values().iterator(); iter.hasNext();) {
            Vector values = (Vector)iter.next();
            for (Iterator valuesIter = values.iterator(); valuesIter.hasNext();) {
                Import wsdlImport = (Import)valuesIter.next();
                modifySchemaImportsAndIncludes(wsdlImport.getDefinition(), name);
            }
        }
    }
View Full Code Here

      List importList = (List)importListIterator.next();
      Iterator importIterator = importList.iterator();

      while (importIterator.hasNext())
      {
        Import _import = (Import)importIterator.next();
        Definition importedDef = _import.getDefinition();
        //String importedNamespace = _import.getNamespaceURI();
        String importedDefTNS = null;

        if (importedDef != null)
        {
          importedDefTNS = importedDef.getTargetNamespace();

          /*
            Since an imported definition was actually resolved, we have to make
            sure that a targetNamespace was specified, and that it matches the
            value of the namespace attribute specified on the <import> element.
           */
          if (importedDefTNS == null || importedDefTNS.equals(""))
          {
            throw new IllegalArgumentException("You cannot <import> WSDL v1.1 " +
                                               "documents that do not " +
                                               "specify the targetNamespace " +
                                               "attribute on the definition " +
                                               "element.");
          }
          else if (!importedDefTNS.equals(_import.getNamespaceURI()))
          {
            throw new IllegalArgumentException("The value of the namespace " +
                                               "attribute on the <import> " +
                                               "element must match the " +
                                               "value of the targetNamespace " +
                                               "attribute specified on the " +
                                               "document being imported.");
          }
        }
        else
        {
          /*
            Since no definition was resolved, use the value from the namespace
            attribute on the <import> element.
           */
          importedDefTNS = _import.getNamespaceURI();

          if (importedDefTNS == null || importedDefTNS.equals(""))
          {
            throw new IllegalArgumentException("You cannot <import> WSDL v1.1 " +
                                               "documents wihout either " +
                                               "specifying the targetNamespace " +
                                               "attribute on the imported " +
                                               "definition element or " +
                                               "specifying the namespace " +
                                               "attribute on the <import> " +
                                               "element.");
          }
        }

        // Determine whether the -targetNS value should be propagated.
        if (newTargetNS != null && !newTargetNS.equals(""))
        {
          if (importedDefTNS.equals(origTargetNamespace))
          {
            importedDefTNS = newTargetNS;
          }
          else if (!importedDefTNS.equals(newTargetNS))
          {
            newTargetNS = null;
          }
        }

        String targetFileName = null;
        String locationURI = _import.getLocationURI();

        if (locationURI != null
            && !locationURI.equals("")
            && importedDef != null)
        {
View Full Code Here

                                     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 {
View Full Code Here

            for (Iterator iterator = imports.entrySet().iterator(); iterator.hasNext();) {
                Map.Entry entry = (Map.Entry) iterator.next();
                String namespaceURI = (String) entry.getKey();
                List importList = (List) entry.getValue();
                for (Iterator iterator1 = importList.iterator(); iterator1.hasNext();) {
                    Import anImport = (Import) iterator1.next();
                    //according to the 1.1 jwsdl mr shcema imports are supposed to show up here,
                    //but according to the 1.0 spec there is supposed to be no Definition.
                    Definition definition1 = anImport.getDefinition();
                    if (definition1 != null) {
                        try {
                            URI uri = new URI(definition1.getDocumentBaseURI());
                            uris.push(uri);
                        } catch (URISyntaxException e) {
View Full Code Here

            for (ServiceInfo service : services) {
                Definition portTypeDef = definition;
                if (!isSameTNS(service)) {
                    portTypeDef = newDefinition(service.getInterface().getName(),
                                                service.getInterface().getName().getNamespaceURI());
                    Import wsdlImport = definition.createImport();
                    String tns = service.getInterface().getName().getNamespaceURI();
                    wsdlImport.setDefinition(portTypeDef);
                    wsdlImport.setNamespaceURI(tns);
                    wsdlImport.setLocationURI(service.getInterface().getName().getLocalPart() + ".wsdl");
                    definition.addImport(wsdlImport);
                    addNamespace(getPrefix(tns), tns, definition);
                }
                portTypes.add(buildPortType(service.getInterface(), portTypeDef));
               
View Full Code Here

                                     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 {
View Full Code Here

            }
        }
        for (Iterator iter = definition.getImports().values().iterator(); iter.hasNext();) {
            Vector values = (Vector)iter.next();
            for (Iterator valuesIter = values.iterator(); valuesIter.hasNext();) {
                Import wsdlImport = (Import)valuesIter.next();
                modifySchemaImportsAndIncludes(wsdlImport.getDefinition(), name);
            }
        }
    }
View Full Code Here

TOP

Related Classes of javax.wsdl.Import

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.