Publish the wsdl imports for a given wsdl definition
320149
@SuppressWarnings("unchecked")
   protected void publishWsdlImports(URL parentURL, Definition parentDefinition, List<String> published, String expLocation) throws Exception
   {
      @SuppressWarnings("rawtypes")
      Iterator it = parentDefinition.getImports().values().iterator();
      while (it.hasNext())
      {
         for (Import wsdlImport : (List<Import>)it.next())
         {
            String locationURI = wsdlImport.getLocationURI();
            // its an external import, don't publish locally
            if (locationURI.startsWith("http://") == false && locationURI.startsWith("https://") == false)
            {
               // infinity loops prevention
               if (published.contains(locationURI))
               {
                  continue;
               }
               else
               {
                  published.add(locationURI);
               }
               
               String baseURI = parentURL.toExternalForm();
               URL targetURL = new URL(baseURI.substring(0, baseURI.lastIndexOf("/") + 1) + locationURI);
               File targetFile = new File(targetURL.getFile()); //JBWS-3488
               createParentDir(targetFile);

               Definition subdef = wsdlImport.getDefinition();
               WSDLFactory wsdlFactory = WSDLFactory.newInstance();
               javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
               BufferedOutputStream bfos = new BufferedOutputStream(new FileOutputStream(targetFile));
               OutputStreamWriter osw = new OutputStreamWriter(bfos, "UTF-8");
               try {
                  wsdlWriter.writeWSDL(subdef, osw);
               } finally {
                  osw.close();
               }

               DEPLOYMENT_LOGGER.wsdlImportPublishedTo(targetURL);

               // recursively publish imports
               publishWsdlImports(targetURL, subdef, published, expLocation);

               // Publish XMLSchema imports
               Element subdoc = DOMUtils.parse(targetURL.openStream(), getDocumentBuilder());
               publishSchemaImports(targetURL, subdoc, published, expLocation);
            }
         }
      }
   }
500437
def import_schema(self, definitions, d):
        """"""
        if not definitions.types:
            root = Element("types", ns=wsdlns)
            definitions.root.insert(root)
            types = Types(root, definitions)
            definitions.types.append(types)
        else:
            types = definitions.types[-1]
        types.root.append(d.root)
        log.debug("imported (XSD):\n%s", d.root)
700972
private function parseWsdl(): void
    {
        $this->printer->writeln('Parsing WSDL.');
        $client = new \SoapClient((string) $this->wsdl);

        foreach ($client->__getTypes() as $rawType) {
            $type = $this->parser->parseType($rawType);

            if ($type instanceof Struct) {
                $this->wsdl->addStruct($type);
            } elseif ($type instanceof Property) {
                $this->wsdl->addSimpleType($type);
            }
        }

        foreach ($client->__getFunctions() as $rawFunction) {
            $method = $this->parser->parseFunction($rawFunction);
            $this->wsdl->addMethod($method);
        }
    }
61564
def build_function_imports
    # Fill in the function imports
    functions = @edmx.xpath("//edm:EntityContainer/edm:FunctionImport", @ds_namespaces)
    functions.each do |f|
      http_method_attribute = f.xpath("@m:HttpMethod", @ds_namespaces).first # HttpMethod is no longer required http://www.odata.org/2011/10/actions-in-odata/
      is_side_effecting_attribute = f.xpath("@edm:IsSideEffecting", @ds_namespaces).first

      http_method = 'POST' # default to POST

      if http_method_attribute
        http_method = http_method_attribute.content
      elsif is_side_effecting_attribute
        is_side_effecting = is_side_effecting_attribute.content
        http_method = is_side_effecting ? 'POST' : 'GET'
      end

      return_type = f["ReturnType"]
      inner_return_type = nil
      unless return_type.nil?
        return_type = (return_type =~ /^Collection/) ? Array : convert_to_local_type(return_type)
        if f["ReturnType"] =~ /\((.*)\)/
          inner_return_type = convert_to_local_type($~[1])
        end
      end
      params = f.xpath("edm:Parameter", @ds_namespaces)
      parameters = nil
      if params.length > 0
        parameters = {}
        params.each do |p|
          parameters[p["Name"]] = p["Type"]
        end
      end
      @function_imports[f["Name"]] = {
        :http_method => http_method,
        :return_type => return_type,
        :inner_return_type => inner_return_type,
        :parameters => parameters }
    end
  end
199853
def open_imports(self, imported_definitions):
        """"""
        for imp in self.imports:
            imp.load(self, imported_definitions)
913663
def visit_importfrom(self, node, parent):
        """"""
        names = [(alias.name, alias.asname) for alias in node.names]
        newnode = nodes.ImportFrom(
            node.module or "",
            names,
            node.level or None,
            getattr(node, "lineno", None),
            getattr(node, "col_offset", None),
            parent,
        )
        # store From names to add them to locals after building
        self._import_from_nodes.append(newnode)
        return newnode
281011
def _prepare_wsdl_objects(self):
        

        self.SelectionDetails = self.client.factory.create('TrackSelectionDetail')

        # Default to Fedex
        self.SelectionDetails.CarrierCode = 'FDXE'

        track_package_id = self.client.factory.create('TrackPackageIdentifier')

        # Default to tracking number.
        track_package_id.Type = 'TRACKING_NUMBER_OR_DOORTAG'

        self.SelectionDetails.PackageIdentifier = track_package_id
1158744
@Bind(id = "importerServices", specification = ImporterService.class, aggregate = true, optional = true)
    void bindImporterService(ServiceReference<ImporterService> serviceReference) {
        synchronized (lock) {
            try {
                importersManager.add(serviceReference);
            } catch (InvalidFilterException invalidFilterException) {
                LOG.error("The ServiceProperty \"" + TARGET_FILTER_PROPERTY + "\" of the ImporterService "
                                + bundleContext.getService(serviceReference) + " doesn't provides a valid Filter."
                                + " To be used, it must provides a correct \"" + TARGET_FILTER_PROPERTY + "\" ServiceProperty.",
                        invalidFilterException
                );
                return;
            }
            if (!importersManager.matched(serviceReference)) {
                return;
            }
            LOG.debug(linkerName + " : Bind the ImporterService "
                    + importersManager.getDeclarationBinder(serviceReference)
                    + " with filter " + importersManager.getTargetFilter(serviceReference));
            importersManager.createLinks(serviceReference);
        }
    }
44433
def setUpClassDef(self, service):
        '''
        '''
        assert isinstance(service, WSDLTools.Service), \
            'expecting WSDLTools.Service instance'

        s = self._services[service.name].classdef
        print >>s, 'class %s(%s):' %(self.getClassName(service.name), self.base_class_name)
        print >>s, '%ssoapAction = {}' % self.getIndent(level=1)
        print >>s, '%swsAction = {}' % self.getIndent(level=1)
        print >>s, '%sroot = {}' % self.getIndent(level=1)
956649
private void writeImports() {

    for (String importType : importTypes) {
      writer.append("import %s;", importType).eol();
    }
    writer.eol();
  }
80266
function(options) {

            /**
             * Namespace.
             * @type {ProtoBuf.Reflect.Namespace}
             * @expose
             */
            this.ns = new Reflect.Namespace(this, null, ""); // Global namespace

            /**
             * Namespace pointer.
             * @type {ProtoBuf.Reflect.T}
             * @expose
             */
            this.ptr = this.ns;

            /**
             * Resolved flag.
             * @type {boolean}
             * @expose
             */
            this.resolved = false;

            /**
             * The current building result.
             * @type {Object.<string,ProtoBuf.Builder.Message|Object>|null}
             * @expose
             */
            this.result = null;

            /**
             * Imported files.
             * @type {Array.<string>}
             * @expose
             */
            this.files = {};

            /**
             * Import root override.
             * @type {?string}
             * @expose
             */
            this.importRoot = null;

            /**
             * Options.
             * @type {!Object.<string, *>}
             * @expose
             */
            this.options = options || {};
        }
242432
def get_definition(self, name):
        ''''''
        # Check if the service is supported
        if name not in SERVICES:
            raise ONVIFError('Unknown service %s' % name)
        wsdl_file = SERVICES[name]['wsdl']
        ns = SERVICES[name]['ns']

        wsdlpath = os.path.join(self.wsdl_dir, wsdl_file)
        if not os.path.isfile(wsdlpath):
            raise ONVIFError('No such file: %s' % wsdlpath)

        # XAddr for devicemgmt is fixed:
        if name == 'devicemgmt':
            xaddr = 'http://%s:%s/onvif/device_service' % (self.host, self.port)
            return xaddr, wsdlpath

        # Get other XAddr
        xaddr = self.xaddrs.get(ns)
        if not xaddr:
            raise ONVIFError('Device doesn`t support service: %s' % name)

        return xaddr, wsdlpath
79845
def import_schema(self, definitions, d):
        
        if not len(definitions.types):
            types = Types.create(definitions)
            definitions.types.append(types)
        else:
            types = definitions.types[-1]
        types.root.append(d.root)
        log.debug('imported (XSD):\n%s', d.root)
265654
def visit_Import(self, node, frame):
        """"""
        self.writeline('%s = ' % frame.symbols.ref(node.target), node)
        if frame.toplevel:
            self.write('context.vars[%r] = ' % node.target)
        if self.environment.is_async:
            self.write('await ')
        self.write('environment.get_template(')
        self.visit(node.template, frame)
        self.write(', %r).' % self.name)
        if node.with_context:
            self.write('make_module%s(context.get_all(), True, %s)'
                       % (self.environment.is_async and '_async' or '',
                          self.dump_local_context(frame)))
        elif self.environment.is_async:
            self.write('_get_default_module_async()')
        else:
            self.write('_get_default_module()')
        if frame.toplevel and not node.target.startswith('_'):
            self.writeline('context.exported_vars.discard(%r)' % node.target)
1304785
public ServiceMethod createAndGatherImports (Method method, ImportSet imports)
    {
        ServiceMethod sm = new ServiceMethod(method);
        sm.gatherImports(imports);
        return sm;
    }
815506
private function triggerTweakwiseImport()
    {
        $apiImportUrl = $this->config->getApiImportUrl();
        if (empty($apiImportUrl)) {
            $this->log->debug('TW import not triggered, no api import url defined.');
            return;
        }

        try {
            $client = new HttpClient($apiImportUrl);
            $client->send();
            $this->log->debug('TW import triggered');
        } catch (HttpClient\Exception\ExceptionInterface $e) {
            $this->log->error(sprintf('Trigger TW import failed due to %s', $e->getMessage()));
        }
    }
170980
public void publish(final List<StepImplementationsDescriptor> stepimplementationDescriptors) {
        final Map<String, List<StepDescriptor>> sectionSorted = new TreeMap<String, List<StepDescriptor>>();

        for (final StepImplementationsDescriptor descriptor : stepimplementationDescriptors) {

            for (final StepDescriptor stepTag : descriptor.getExpressions()) {

                String section = stepTag.getSection();
                if (section == null || section.isEmpty()) {
                    section = "Miscellaneous";
                }

                List<StepDescriptor> subList = sectionSorted.get(section);

                if (subList == null) {
                    subList = new ArrayList<StepDescriptor>();
                    sectionSorted.put(section, subList);
                }
                subList.add(stepTag);
            }
        }

        final String html = buildHtml(sectionSorted);

        outputFile.delete();

        // write out
        try {
            if (outputFile.createNewFile()) {
                Files.write(html, outputFile, Charset.defaultCharset());
            } else {
                // TODO
            }
        } catch (final IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }