Examples of WSDLDescription


Examples of org.apache.wsdl.WSDLDescription

    public AxisBindingBuilder() {
    }


    public void engage() {
        WSDLDescription wom = this.configuration.getWom();
        Map bindingMap = wom.getBindings();
        Vector bindingVector = new Vector();

        if (bindingMap == null || bindingMap.isEmpty()) {
            log.info(CodegenMessages.getMessage("extension.bindingMissing"));
            //just fall through
        } else {
            Collection bindingCollection = bindingMap.values();
            for (Iterator iterator = bindingCollection.iterator(); iterator.hasNext();) {

                WSDLBinding binding = (WSDLBinding) iterator.next();

                WSDLBinding newBinding = wom.createBinding();
                newBinding.setName(AXIS_BINDING_QNAME);

                WSDLInterface boundInterface = binding.getBoundInterface();
                newBinding.setBoundInterface(boundInterface);

                newBinding.setBindingFaults(binding.getBindingFaults());
                newBinding.setBindingOperations(binding.getBindingOperations());
                Iterator elementIterator = binding.getExtensibilityElements().iterator();
                while (elementIterator.hasNext()) {
                    newBinding.addExtensibilityElement(
                            (WSDLExtensibilityElement) elementIterator.next());
                }

                Iterator attributeIterator = binding.getExtensibilityAttributes()
                        .iterator();
                while (attributeIterator.hasNext()) {
                    newBinding.addExtensibleAttributes(
                            (WSDLExtensibilityAttribute) attributeIterator.next());
                }
                bindingVector.add(newBinding);

            }
            //drop all the bindings and add the new ones
            wom.getBindings().clear();
            for (int i = 0; i < bindingVector.size(); i++) {
                wom.addBinding((WSDLBinding) bindingVector.get(i));
            }

        }
    }
View Full Code Here

Examples of org.apache.wsdl.WSDLDescription

  public void engage() {
       
        // TODO XSLTConstants.BASE_64_PROPERTY_KEY
       
       
    WSDLDescription womDescription = configuration.getWom();
    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;
      }

      WSDLBinding wsdlBinding = wsdlEndpoint.getBinding();
      wsdlInterface = wsdlBinding.getBoundInterface();

      for (Iterator iterator = wsdlInterface.getOperations().values()
          .iterator(); iterator.hasNext();) {
        WSDLOperation wsdlOperation = (WSDLOperation) iterator.next();
        Policy policy = util.getPolicyForOperation(wsdlEndpoint.getName(),
            wsdlOperation.getName());

        if (policy != null) {
          processPolicies(document, rootElement, policy,
              wsdlEndpoint, wsdlOperation);
        }
      }

    }

    for (Iterator iterator = womDescription.getWsdlInterfaces().values()
        .iterator(); iterator.hasNext();) {
      wsdlInterface = (WSDLInterface) iterator.next();
      break;
    }
View Full Code Here

Examples of org.apache.wsdl.WSDLDescription

     * Populate the info holder looking at the WOM
     */
    private void populateInformationHolder() {
        infoHolder = new InformationHolder();

        WSDLDescription wsdlDescription = configuration.getWom();
        int codegenStyle = this.configuration.getCodeGenerationStyle();

        // user explicity asked for the interface mode, so we can get
        // away with the populating the portype only
        if (codegenStyle == XSLTConstants.CodegenStyle.INTERFACE) {
            populatePorttype(infoHolder, wsdlDescription);

            return;
        }

        // 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()));
View Full Code Here

Examples of org.apache.wsdl.WSDLDescription

        this.configuration = configuration;
        loadExtensions();
    }

    public CodeGenerationEngine(CommandLineOptionParser parser) throws CodeGenerationException {
        WSDLDescription wom;
        Map allOptions = parser.getAllOptions();
        try {

            CommandLineOption option = (CommandLineOption)allOptions.get(CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION);
            wom = this.getWOM(option.getOptionValue());
View Full Code Here

Examples of org.apache.wsdl.WSDLDescription

     * Populate the info holder looking at the WOM
     */
    private void populateInformationHolder() {
        infoHolder = new InformationHolder();

        WSDLDescription wsdlDescription = configuration.getWom();
        int codegenStyle = this.configuration.getCodeGenerationStyle();

        // user explicity asked for the interface mode, so we can get
        // away with the populating the portype only
        if (codegenStyle == XSLTConstants.CodegenStyle.INTERFACE) {
            populatePorttype(infoHolder, wsdlDescription);

            return;
        }

        // 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()));
View Full Code Here

Examples of org.apache.wsdl.WSDLDescription

    public AxisBindingBuilder() {
    }


    public void engage() {
        WSDLDescription wom = this.configuration.getWom();
        Map bindingMap = wom.getBindings();
        Vector bindingVector = new Vector();

        if (bindingMap == null || bindingMap.isEmpty()) {
            log.info(CodegenMessages.getMessage("extension.bindingMissing"));
            //just fall through
        } else {
            Collection bindingCollection = bindingMap.values();
            for (Iterator iterator = bindingCollection.iterator(); iterator.hasNext();) {

                WSDLBinding binding = (WSDLBinding) iterator.next();

                WSDLBinding newBinding = wom.createBinding();
                newBinding.setName(AXIS_BINDING_QNAME);

                WSDLInterface boundInterface = binding.getBoundInterface();
                newBinding.setBoundInterface(boundInterface);

                newBinding.setBindingFaults(binding.getBindingFaults());
                newBinding.setBindingOperations(binding.getBindingOperations());
                Iterator elementIterator = binding.getExtensibilityElements().iterator();
                while (elementIterator.hasNext()) {
                    newBinding.addExtensibilityElement(
                            (WSDLExtensibilityElement) elementIterator.next());
                }

                Iterator attributeIterator = binding.getExtensibilityAttributes()
                        .iterator();
                while (attributeIterator.hasNext()) {
                    newBinding.addExtensibleAttributes(
                            (WSDLExtensibilityAttribute) attributeIterator.next());
                }
                bindingVector.add(newBinding);

            }
            //drop all the bindings and add the new ones
            wom.getBindings().clear();
            for (int i = 0; i < bindingVector.size(); i++) {
                wom.addBinding((WSDLBinding) bindingVector.get(i));
            }

        }
    }
View Full Code Here

Examples of org.apache.wsdl.WSDLDescription

*/
public class WSDL1ToWOMBuilder implements WOMBuilder {

    public WSDLVersionWrapper build(InputStream in) throws WSDLException {

        WSDLDescription wsdlDescription = new WSDLDescriptionImpl();

        Definition wsdl1Definition = this.readInTheWSDLFile(in);
    WSDLPump pump = new WSDLPump(wsdlDescription, wsdl1Definition);
        pump.pump();

View Full Code Here

Examples of org.apache.wsdl.WSDLDescription

        return new WSDLVersionWrapper(wsdlDescription, wsdl1Definition);
    }
   
    public WSDLVersionWrapper build (InputStream in, WSDLComponentFactory wsdlComponentFactory) throws WSDLException{
      WSDLDescription wsdlDescription = wsdlComponentFactory.createDescription();

        Definition wsdl1Definition = this.readInTheWSDLFile(in);
    WSDLPump pump = new WSDLPump(wsdlDescription, wsdl1Definition, wsdlComponentFactory);
        pump.pump();
View Full Code Here

Examples of org.apache.wsdl.WSDLDescription

                * or give a (custom) progress monitor to the generate() method, so
                * we will be informed by Axis2 about the progress of code generation. 
                */
               WSDL2JavaGenerator generator = new WSDL2JavaGenerator();
               monitor.subTask(CodegenWizardPlugin.getResourceString("generator.readingWOM"));
               WSDLDescription wom = generator.getWOM(wsdlSelectionPage.getFileName());
               monitor.worked(1);
              
               Map optionsMap = generator.fillOptionMap(optionsPage.isAsyncOnlyOn(),
                                         optionsPage.isSyncOnlyOn(),
                                         optionsPage.isServerside(),
View Full Code Here

Examples of org.apache.wsdl.WSDLDescription

        if (null == this.service) {
           InputStream in = new FileInputStream(new File("./test-resources/service.wsdl")) ;
            if(in == null){
                throw new Exception("Input Stream is null , fileNot Found") ;
            }
            WSDLDescription womDescription = WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11).build(in, new AxisDescWSDLComponentFactory()).getDescription();
            Iterator iterator = womDescription.getServices().keySet().iterator();
            if(iterator.hasNext()){
                this.service = (ServiceDescription)iterator.next();
            }
            //todo fix me ajith , deepal
           // assertNotNull(this.service);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.