Package org.apache.wsdl

Examples of org.apache.wsdl.WSDLDescription


        // TODO: operations can be put on the endpoint
        String name = ((AbstractServiceEndpoint) endpoints[i]).getComponent();
        RegistryComponent info = this.channel.getContainer().getRegistry().getComponent(name);
        Document doc = ((Component)info.getComponent()).getServiceDescription(endpoints[i]);
        String uri = doc.getDocumentElement().getNamespaceURI();
        WSDLDescription desc = null;
        if (WSDLConstants.WSDL2_0_NAMESPACE.equals(uri)) {
          throw new UnsupportedOperationException(uri);
        } else if (WSDLConstants.WSDL1_1_NAMESPACE.equals(uri)) {
              WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
              Definition def = reader.readWSDL(null, doc);
              desc = new WSDLDescriptionImpl();
          WSDLPump pump = new WSDLPump(desc, def);
              pump.pump();
        } else {
          throw new UnsupportedOperationException();
        }
        //WSDLService service = desc.getService(endpoints[i].getServiceName());
        //WSDLEndpoint endpoint = service.getEndpoint(new QName(service.getNamespace(), endpoints[i].getEndpointName()));
        Collection interfaces = desc.getWsdlInterfaces().values();
        for (Iterator iter = interfaces.iterator(); iter.hasNext();) {
          WSDLInterface itf = (WSDLInterface) iter.next();
          WSDLOperation op = itf.getOperation(operationName.getLocalPart());
          if (op != null) {
            meps.add(op.getMessageExchangePattern());
View Full Code Here


        }
        schema.write(writer);
        writer.flush();
        Document doc = domBuilder.parse(new ByteArrayInputStream(writer.toString().getBytes()));
        Element documentElement = doc.getDocumentElement();
        WSDLDescription womDescription;
        WSDLComponentFactory wsdlComponentFactory = new WSDLDescriptionImpl();
        womDescription = wsdlComponentFactory.createDescription();
        HashMap namespaceMap = new HashMap();
        namespaceMap.put("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
        namespaceMap.put(targetNamespecheprefix, targetNamespece);
        namespaceMap.put("ns1", "http://org.apache.axis2/xsd");
        namespaceMap.put("xs", "http://www.w3.org/2001/XMLSchema");
        womDescription.setNamespaces(namespaceMap);
        womDescription.setTargetNameSpace(targetNamespece);

        //generating port type
        WSDLInterface portType = generatePortType(womDescription, wsdlComponentFactory, documentElement);
        womDescription.addInterface(portType);

        QName bindingName = new QName(targetNamespece, axisService.getName() + "Binding"
                , targetNamespecheprefix);
        //generating binding
        WSDLBinding binding = generateBinding(wsdlComponentFactory,
                portType,
                bindingName,
                "document", "literal", "http://schemas.xmlsoap.org/soap/http",
                "http://www.org.apache.axis2");
        womDescription.addBinding(binding);

        //generating axisService
        WSDLService service = generateService(wsdlComponentFactory, binding,
                axisService.getName(), url);
        womDescription.addService(service);
        return womDescription;
    }
View Full Code Here

    public void printUsingWOM(OutputStream out, String serviceURL) throws AxisFault {
        //todo : This is a tempory hack pls imporve me : Deepal
        AxisService2WOM axisService2WOM = new AxisService2WOM(getSchema(), this, null, null, serviceURL);
        try {
            WSDLDescription desc = axisService2WOM.generateWOM();

            // populate it with policy information ..
            //TODO : This gives an NPE , Sanka pls fix that
            PolicyUtil.populatePolicy(desc, this);
View Full Code Here

            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

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

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

    public WSDLVersionWrapper build(String uri,
                                    WSDLComponentFactory wsdlComponentFactory) throws WSDLException {
      if(null == wsdlComponentFactory){
        wsdlComponentFactory = new WSDLDescriptionImpl();
      }
        WSDLDescription wsdlDescription = wsdlComponentFactory.createDescription();

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

        this.configuration = config;
        loadExtensions();
    }

    public CodeGenerationEngine(CommandLineOptionParser parser) throws CodeGenerationException {
        WSDLDescription wom;
        try {
            wom = this.getWOM(parser);
        } catch (WSDLException e) {
            throw new CodeGenerationException("Error parsing WSDL", e);
        } catch (IOException e1) {
View Full Code Here

        try {
            if (in != null) {
                WOMBuilder builder = WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11);
                WSDLVersionWrapper wsdlVersionWrapper = builder.build(in,
                        new AxisDescWSDLComponentFactory());
                WSDLDescription womDescription = wsdlVersionWrapper.getDescription();
                Iterator iterator = womDescription.getServices().keySet()
                        .iterator();
                if (iterator.hasNext()) {
                    foundservice = true;
                    // remove <wsdl:service> and <wsdl:binding> elements from the service
                    // description we read in as we will be replacing them anyway.

                    WSDLServiceImpl serviceimpl = (WSDLServiceImpl) womDescription.getServices().get(iterator.next());
                    service = new ServiceDescription(serviceimpl);
//                    service =
//                            (ServiceDescription) womDescription.getServices()
//                            .get(iterator.next());
                }
View Full Code Here

    private void processWSDLFile(InputStream in , DeploymentEngine depengine) throws DeploymentException {
        try {
            WOMBuilder builder = WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11);
            WSDLVersionWrapper wsdlVersionWrapper = builder.build(in,
                    new AxisDescWSDLComponentFactory());
            WSDLDescription womDescription = wsdlVersionWrapper.getDescription();
            Iterator iterator = womDescription.getServices().keySet()
                    .iterator();
            if (iterator.hasNext()) {
                // remove <wsdl:service> and <wsdl:binding> elements from the service
                // description we read in as we will be replacing them anyway.
                WSDLServiceImpl serviceimpl = (WSDLServiceImpl)
                        womDescription.getServices().get(iterator.next());
                ServiceDescription service = new ServiceDescription(serviceimpl);
                service.setName(serviceimpl.getName());
                service.setWSDLDefinition(wsdlVersionWrapper.getDefinition());
                depengine.getCurrentFileItem().addService(service);
            }
View Full Code Here

            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(
                    WSDLConstants.WSDL_1_1)
                    .build(in, new AxisDescWSDLComponentFactory())
                    .getDescription();
            Iterator iterator = womDescription.getServices().keySet().iterator();
            if (iterator.hasNext()) {
                this.service = (AxisService) iterator.next();
            }
            //todo fix me ajith , deepal
            // assertNotNull(this.service);
View Full Code Here

TOP

Related Classes of org.apache.wsdl.WSDLDescription

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.