Package org.apache.wsdl

Examples of org.apache.wsdl.WSDLService


    }

    private WSDLEndpoint getEndpoint(QName epName) {
        Iterator iterator = wsdlDescription.getServices().values().iterator();
        while (iterator.hasNext()) {
            WSDLService service = (WSDLService) iterator.next();
            if (service.getEndpoints().containsKey(epName)) {
                return service.getEndpoint(epName);
            }
        }
        return null;
    }
View Full Code Here


            registerPoliciesInWSDLBinding(wsdlBinding);
        }

        iterator = des.getServices().values().iterator();
        while (iterator.hasNext()) {
            WSDLService service = (WSDLService) iterator.next();
            registerPoliciesInService(service);
        }

        iterator = reg.keys();
        while (iterator.hasNext()) {
View Full Code Here

    String serviceName = configuration.getServiceName();

    Document document = getEmptyDocument();
    Element rootElement = document.createElement("stubMethods");

    WSDLService wsdlService = null;
    WSDLInterface wsdlInterface = null;

    if (serviceName != null) {
      wsdlService = womDescription.getService(new QName(serviceName));
    } else {
      for (Iterator iterator = womDescription.getServices().values()
          .iterator(); iterator.hasNext();) {
        wsdlService = (WSDLService) iterator.next();
        serviceName = wsdlService.getName().getLocalPart();
        configuration.setServiceName(serviceName);
        break;
      }
    }

    if (wsdlService != null) {

      String port = configuration.getPortName();
      WSDLEndpoint wsdlEndpoint = null;

      if (port == null) {
        for (Iterator iterator = wsdlService.getEndpoints().values()
            .iterator(); iterator.hasNext();) {
          wsdlEndpoint = (WSDLEndpoint) iterator.next();
          port = wsdlEndpoint.getName().getLocalPart();
          configuration.setPortName(port);
          break;

        }
      } else {
        wsdlEndpoint = wsdlService.getEndpoint(new QName(port));
      }
      if (wsdlEndpoint == null) {
        System.err.println("no wsdl:port found for the service");
        return;
      }
View Full Code Here

    /**
     * Creates the DOM tree for the Ant build. Uses the interface.
     */
    protected Document createDOMDocumentForAntBuild() {
        WSDLInterface wsdlInterface = infoHolder.getWSDLinterface();
        WSDLService service = infoHolder.getService();
        Document doc = getEmptyDocument();
        Element rootElement = doc.createElement("ant");
        String localPart = getCoreClassName(wsdlInterface);
        String packageName = configuration.getPackageName();
        String[]      dotSeparatedValues = packageName.split("\\.");

        addAttribute(doc, "package", dotSeparatedValues[0], rootElement);
        addAttribute(doc, "name", localPart, rootElement);

        String servicename = localPart;

        if (service != null) {
            servicename = service.getName().getLocalPart();
        }

        addAttribute(doc, "servicename", servicename, rootElement);
        doc.appendChild(rootElement);

View Full Code Here

    }

    protected Document createDOMDocumentForServiceXML() {
        WSDLInterface boundInterface = infoHolder.getWSDLinterface();
        WSDLBinding axisBinding = infoHolder.getBinding();
        WSDLService service = infoHolder.getService();
        Document doc = getEmptyDocument();
        String coreClassName = getCoreClassName(boundInterface);

        // WSDLEndpoint endpoint = infoHolder.getPort();
        if (service != null) {
            doc.appendChild(getServiceElement(service.getName().getLocalPart(), coreClassName, doc, boundInterface,
                    axisBinding));
        } else {

            // service is missing. However we can derive a service name from the WSDLinterface
            doc.appendChild(getServiceElement(boundInterface.getName().getLocalPart(), coreClassName, doc,
View Full Code Here

        // start with the service
        Map services = wsdlDescription.getServices();

        if ((services != null) && !services.isEmpty()) {
            WSDLService selectedService;
            WSDLEndpoint selectedEndpoint;

            if (services.size() > 1) {

                // look for the users setting here
                if (configuration.getServiceName() != null) {
                    selectedService = wsdlDescription.getService(new QName(configuration.getWom().getTargetNameSpace(),
                            configuration.getServiceName()));

                    if (selectedService == null) {
                        throw new RuntimeException(CodegenMessages.getMessage("emitter.serviceNotFoundError",
                                configuration.getServiceName()));
                    }
                } else {

                    // print warning
                    System.out.println(CodegenMessages.getMessage("emitter.warningMultipleServices"));
                    // note - we are sure of no NPE's here
                    selectedService = (WSDLService) services.values().iterator().next();
                }
            } else {
                // note - we are sure of no NPE's here
                selectedService = (WSDLService) services.values().iterator().next();
            }

            infoHolder.setService(selectedService);

            // get the ports from the service
            Map endpoints = selectedService.getEndpoints();

            if ((endpoints != null) && !endpoints.isEmpty()) {
                if (endpoints.size() > 1) {

                    // look for the users setting here
                    if (configuration.getPortName() != null) {
                        selectedEndpoint =
                                selectedService.getEndpoint(new QName(configuration.getWom().getTargetNameSpace(),
                                        configuration.getPortName()));

                        if (selectedEndpoint == null) {
                            throw new RuntimeException(CodegenMessages.getMessage("emitter.endpointNotFoundError"));
                        }
View Full Code Here

    /**
     * Creates the DOM tree for the Ant build. Uses the interface.
     */
    protected Document createDOMDocumentForAntBuild() {
        WSDLInterface wsdlInterface = infoHolder.getPorttype();
        WSDLService service = infoHolder.getService();
        Document doc = getEmptyDocument();
        Element rootElement = doc.createElement("ant");
        String localPart = getCoreClassName(wsdlInterface);
        String packageName = configuration.getPackageName();
        String[]      dotSeparatedValues = packageName.split("\\.");

        addAttribute(doc, "package", dotSeparatedValues[0], rootElement);
        addAttribute(doc, "name", localPart, rootElement);

        String servicename = localPart;

        if (service != null) {
            servicename = service.getName().getLocalPart();
        }

        addAttribute(doc, "servicename", servicename, rootElement);
        doc.appendChild(rootElement);

View Full Code Here

    }

    protected Document createDOMDocumentForServiceXML() {
        WSDLInterface boundInterface = infoHolder.getPorttype();
        WSDLBinding axisBinding = infoHolder.getBinding();
        WSDLService service = infoHolder.getService();
        Document doc = getEmptyDocument();
        String coreClassName = getCoreClassName(boundInterface);

        // WSDLEndpoint endpoint = infoHolder.getPort();
        if (service != null) {
            doc.appendChild(getServiceElement(service.getName().getLocalPart(), coreClassName, doc, boundInterface,
                    axisBinding));
        } else {

            // service is missing. However we can derive a service name from the porttype
            doc.appendChild(getServiceElement(boundInterface.getName().getLocalPart(), coreClassName, doc,
View Full Code Here

        // start with the service
        Map services = wsdlDescription.getServices();

        if ((services != null) && !services.isEmpty()) {
            WSDLService selectedService;
            WSDLEndpoint selectedEndpoint;

            if (services.size() > 1) {

                // look for the users setting here
                if (configuration.getServiceName() != null) {
                    selectedService = wsdlDescription.getService(new QName(configuration.getWom().getTargetNameSpace(),
                            configuration.getServiceName()));

                    if (selectedService == null) {
                        throw new RuntimeException(CodegenMessages.getMessage("emitter.serviceNotFoundError",
                                configuration.getServiceName()));
                    }
                } else {

                    // print warning
                    System.out.println(CodegenMessages.getMessage("emitter.warningMultipleServices"));
                    // note - we are sure of no NPE's here
                    selectedService = (WSDLService) services.values().iterator().next();
                }
            } else {
                // note - we are sure of no NPE's here
                selectedService = (WSDLService) services.values().iterator().next();
            }

            infoHolder.setService(selectedService);

            // get the ports from the service
            Map endpoints = selectedService.getEndpoints();

            if ((endpoints != null) && !endpoints.isEmpty()) {
                if (endpoints.size() > 1) {

                    // look for the users setting here
                    if (configuration.getPortName() != null) {
                        selectedEndpoint =
                                selectedService.getEndpoint(new QName(configuration.getWom().getTargetNameSpace(),
                                        configuration.getPortName()));

                        if (selectedEndpoint == null) {
                            throw new RuntimeException(CodegenMessages.getMessage("emitter.endpointNotFoundError"));
                        }
View Full Code Here

TOP

Related Classes of org.apache.wsdl.WSDLService

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.