Examples of WSDLToAxisServiceBuilder


Examples of org.apache.axis2.description.WSDLToAxisServiceBuilder

                // lets check the namespace of the root element and decide. But since we are
                // using axiom (dude, you are becoming handy here :)), we will not build the
                // whole thing.
                OMNamespace documentElementNS = new StAXOMBuilder(in).getDocumentElement().getNamespace();
                if (documentElementNS != null) {
                    WSDLToAxisServiceBuilder wsdlToAxisServiceBuilder = null;
                    if (WSDLConstants.WSDL20_2006Constants.DEFAULT_NAMESPACE_URI.equals(documentElementNS.getNamespaceURI())) {
                        // we have a WSDL 2.0 document here.
                        in2 = new FileInputStream(file1);
                        wsdlToAxisServiceBuilder = new WSDL20ToAxisServiceBuilder(in2, null, null);
                    } else if (Constants.NS_URI_WSDL11.
View Full Code Here

Examples of org.apache.axis2.description.WSDLToAxisServiceBuilder

    public AxisServiceGenerator(){
        super();
    }
   
    public AxisService getServiceFromWSDL(org.apache.geronimo.jaxws.PortInfo portInfo, String endpointClassName, Definition wsdlDefinition, ClassLoader classLoader) throws Exception {
        WSDLToAxisServiceBuilder wsdlBuilder = null;
        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLWriter writer = factory.newWSDLWriter();
       
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        writer.writeWSDL(wsdlDefinition, out);
        String wsdlContent = out.toString(WSDL_ENCODING); //Will the Axis2 give us this information soon ?
       
           OMNamespace documentElementNS = ((OMElement)XMLUtils.toOM(new StringReader(wsdlContent))).getNamespace();
          
           Map<QName, Service> serviceMap = wsdlDefinition.getServices();
        Service wsdlService = serviceMap.values().iterator().next();
       
        Map<String, Port> portMap = wsdlService.getPorts();
        Port port = portMap.values().iterator().next();
        String portName = port.getName();
           QName serviceQName = wsdlService.getQName();

           //Decide WSDL Version :
        if(WSDLConstants.WSDL20_2006Constants.DEFAULT_NAMESPACE_URI.equals(documentElementNS.getNamespaceURI())){
            wsdlBuilder = new WSDL20ToAxisServiceBuilder(new ByteArrayInputStream(wsdlContent.getBytes()), serviceQName, null);
        }
        else if(Constants.NS_URI_WSDL11.equals(documentElementNS.getNamespaceURI())){
            wsdlBuilder = new WSDL11ToAxisServiceBuilder(wsdlDefinition, serviceQName , portName);
        }
        //populate with axis2 objects
        AxisService service = wsdlBuilder.populateService();
        service.addParameter(new Parameter(Constants.SERVICE_CLASS, endpointClassName));
        service.setWsdlFound(true);
        service.setClassLoader(classLoader);
       
        //Going to create annotations by hand
View Full Code Here

Examples of org.apache.axis2.description.WSDLToAxisServiceBuilder

        Definition definition = wsBinding.getWSDLDocument();
        QName serviceQName = wsBinding.getService().getQName();
        Definition def = getDefinition(definition, serviceQName);

        final WSDLToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(def, serviceQName, port.getName());
        builder.setServerSide(true);
        // [rfeng] Add a custom resolver to work around WSCOMMONS-228
        // TODO - 228 is resolved, is this still required
        builder.setCustomResolver(new URIResolverImpl(def));
        builder.setBaseUri(def.getDocumentBaseURI());
        // [rfeng]
        // AxisService axisService = builder.populateService();
        // Allow privileged access to read properties. Requires PropertiesPermission read in
        // security policy.
        AxisService axisService;
        try {
            axisService = AccessController.doPrivileged(new PrivilegedExceptionAction<AxisService>() {
                public AxisService run() throws AxisFault {
                    return builder.populateService();
                }
            });
        } catch (PrivilegedActionException e) {
            throw (AxisFault)e.getException();
        }
View Full Code Here

Examples of org.apache.axis2.description.WSDLToAxisServiceBuilder

        Axis2ServiceClient.setServiceAndPort(wsBinding);
        QName serviceQName = wsBinding.getServiceName();
        String portName = wsBinding.getPortName();

        WSDLToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(definition, serviceQName, portName);
        builder.setServerSide(true);
        // [rfeng] Add a custom resolver to work around WSCOMMONS-228
        builder.setCustomResolver(new URIResolverImpl(definition));
        builder.setBaseUri(definition.getDocumentBaseURI());
        // [rfeng]
        AxisService axisService = builder.populateService();

        String path = URI.create(wsBinding.getURI()).getPath();
        axisService.setName(path);
        axisService.setDocumentation("Tuscany configured AxisService for service: " + wsBinding.getURI());
View Full Code Here

Examples of org.apache.axis2.description.WSDLToAxisServiceBuilder

                definition = wsdlFile.toURL().openStream();
            } catch (Exception e) {
                throw new AxisFault("exception opening wsdl", e);
            }

            WSDLToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(definition);
            builder.setServerSide(true);
            axisService = builder.populateService();

            //axisService.setScope(Constants.SCOPE_APPLICATION);
            Parameter userWSDL = new Parameter("useOriginalwsdl", "true");
            axisService.addParameter(userWSDL);
View Full Code Here

Examples of org.apache.axis2.description.WSDLToAxisServiceBuilder

        }
       
        String portName = portInfo.getWsdlPort() == null ? port.getName() : portInfo.getWsdlPort().getLocalPart();
        QName serviceQName = portInfo.getWsdlService() == null ? wsdlService.getQName() : portInfo.getWsdlService();

        WSDLToAxisServiceBuilder wsdlBuilder = new WSDL11ToAxisServiceBuilder(wsdlDefinition, serviceQName , portName);

        //populate with axis2 objects
        AxisService service = wsdlBuilder.populateService();
        service.addParameter(new Parameter(Constants.SERVICE_CLASS, endpointClassName));
        service.setWsdlFound(true);
        service.setClassLoader(classLoader);
       
        Class endPointClass = classLoader.loadClass(endpointClassName);
View Full Code Here

Examples of org.apache.axis2.description.WSDLToAxisServiceBuilder

                        // using axiom (dude, you are becoming handy here :)), we will not build the
                        // whole thing.
                        OMNamespace documentElementNS =
                                ((OMElement) XMLUtils.toOM(in)).getNamespace();
                        if (documentElementNS != null) {
                            WSDLToAxisServiceBuilder wsdlToAxisServiceBuilder = null;
                            if (WSDL2Constants.WSDL_NAMESPACE
                                    .equals(documentElementNS.getNamespaceURI())) {
                                // we have a WSDL 2.0 document here.
                                wsdlToAxisServiceBuilder = new WSDL20ToAxisServiceBuilder(
                                        new ByteArrayInputStream(out.toByteArray()), null, null);
                                wsdlToAxisServiceBuilder.setBaseUri(entryName);
                            } else if (Constants.NS_URI_WSDL11.
                                    equals(documentElementNS.getNamespaceURI())) {
                                wsdlToAxisServiceBuilder = new WSDL11ToAxisServiceBuilder(
                                        new ByteArrayInputStream(out.toByteArray()), null, null);
                            } else {
View Full Code Here

Examples of org.apache.axis2.description.WSDLToAxisServiceBuilder

                // lets check the namespace of the root element and decide. But since we are
                // using axiom (dude, you are becoming handy here :)), we will not build the
                // whole thing.
                OMNamespace documentElementNS = ((OMElement) XMLUtils.toOM(in)).getNamespace();
                if (documentElementNS != null) {
                    WSDLToAxisServiceBuilder wsdlToAxisServiceBuilder = null;
                    if (WSDL2Constants.WSDL_NAMESPACE
                            .equals(documentElementNS.getNamespaceURI())) {
                        // we have a WSDL 2.0 document here.
                        in2 = new FileInputStream(file1);
                        wsdlToAxisServiceBuilder = new WSDL20ToAxisServiceBuilder(in2, null, null);
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.