Package javax.wsdl

Examples of javax.wsdl.Service


        assertTrue("New wsdl file is not generated", outputFile.exists());
        WSDLToJavaProcessor processor = new WSDLToJavaProcessor();
        processor.setEnvironment(env);
        try {
            processor.parseWSDL(outputFile.getAbsolutePath());
            Service service = processor.getWSDLDefinition().getService(
                                                                       new QName(processor
                                                                           .getWSDLDefinition()
                                                                           .getTargetNamespace(),
                                                                                 "serviceins"));
            if (service == null) {
                fail("Element wsdl:service serviceins Missed!");
            }
            Iterator it = service.getPort("portins").getExtensibilityElements().iterator();
            if (service == null) {
                fail("Element wsdl:port portins Missed!");
            }
            boolean found = false;
            while (it.hasNext()) {
View Full Code Here


        //Check For Different Bindings.
        SourceType st = source.get(0);
        DestinationType dt = dest.get(0);
       
        //Get Service Name
        Service sourceService = model.getService(st.getService());
        Service destService = model.getService(dt.getService());
        if (null == sourceService
            || null == destService) {
            return false;
        }
       
        Port sourcePort = sourceService.getPort(st.getPort());
        Port destPort = destService.getPort(dt.getPort());
       
        if (null == sourcePort
            || null == destPort) {
            return false;
        }
View Full Code Here

        if (null == sourcePortMap) {
            sourcePortMap = new HashMap<QName, Port>(stList.size());
        }

        for (SourceType st : stList) {
            Service sourceService = wsdlModel.getService(st.getService());
            if (null == sourceService) {
                throw new WebServiceException(
                            new Message("UNDEFINED_SERVICE", LOG, st.getService()).toString());
            }
            Port sourcePort = sourceService.getPort(st.getPort());
           
            if (null == sourcePort) {
                throw new WebServiceException(
                            new Message("UNDEFINED_PORT", LOG, st.getPort()).toString());               
            }
            sourcePortMap.put(sourceService.getQName(), sourcePort);
        }
    }
View Full Code Here

        if (null == destPortMap) {
            destPortMap = new HashMap<QName, Port>(dtList.size());
        }

        for (DestinationType dt : dtList) {
            Service destService = wsdlModel.getService(dt.getService());
            if (null == destService) {
                throw new WebServiceException(
                            new Message("UNDEFINED_SERVICE", LOG, dt.getService()).toString());
            }
            Port destPort = destService.getPort(dt.getPort());
           
            if (null == destPort) {
                throw new WebServiceException(
                            new Message("UNDEFINED_PORT", LOG, dt.getPort()).toString());               
            }
            destPortMap.put(destService.getQName(), destPort);
        }
    }
View Full Code Here

            for (final Iterator iterator = services.keySet().iterator(); iterator.hasNext();)
            {
                final QName name = (QName)iterator.next();
                if (this.serviceClass.getSimpleName().equals(name.getLocalPart()))
                {
                    final Service service = (Service)services.get(name);
                    final Map ports = service.getPorts();
                    for (final Iterator portIterator = ports.keySet().iterator(); portIterator.hasNext();)
                    {
                        final String portName = (String)portIterator.next();
                        final Port port = (Port)ports.get(portName);
                        for (final Iterator addressIterator = port.getExtensibilityElements().iterator();
View Full Code Here

            }
            return;
        }
        Iterator ite = services.iterator();
        while (ite.hasNext()) {
            Service service = (Service)ite.next();
            processService(model, service);
        }
    }
View Full Code Here

        extensionRegistry = definition.getExtensionRegistry();
       
    }
   
    public void generate() {
        Service service = definition.createService();
        service.setQName(new QName(WSDLConstants.WSDL_PREFIX, wmodel.getServiceName()));
        Port port = definition.createPort();
        port.setName(wmodel.getPortName());
        Binding binding = definition.createBinding();
        String targetNameSpace = wmodel.getTargetNameSpace();
        binding.setQName(new QName(targetNameSpace, wmodel.getPortTypeName() + "Binding"));
        port.setBinding(binding);
        SOAPAddress soapAddress = null;
        try {
            soapAddress = (SOAPAddress)extensionRegistry
                .createExtension(Port.class, new QName(WSDLConstants.SOAP11_NAMESPACE, "address"));
            soapAddress.setLocationURI(ADDRESS_URI);
        } catch (WSDLException e) {
            throw new ToolException(e.getMessage(), e);
        }
        port.addExtensibilityElement(soapAddress);
        service.addPort(port);
        definition.addService(service);
    }
View Full Code Here

                if (jaxbVal instanceof ServiceNameType) {
                    Port port = null;
                    ServiceNameType snt = (ServiceNameType)jaxbVal;
                    LOG.log(Level.FINEST, "found service name ", snt.getEndpointName());
                    Service service = def.getService(snt.getValue());
                    if (service == null) {
                        service = (Service)def.getServices().values().iterator().next();
                        if (service == null) {
                            return null;
                        }
                    }
                    String endpoint = snt.getEndpointName();
                    if ("".equals(endpoint) && service.getPorts().size() == 1) {
                        port = (Port)service.getPorts().values().iterator().next();
                    } else {
                        port = service.getPort(endpoint);
                    }
                    // FIXME this needs to be looked at service.getPort(endpoint)
                    //should not return null when endpoint is valid
                    if (port == null) {
                        port = (Port)service.getPorts().values().iterator().next();
                    }
                    return port;
                }
            }
        }

        if (def.getServices().size() == 1) {
            Service service = (Service)def.getServices().values().iterator().next();
            if (service.getPorts().size() == 1) {
                return (Port)service.getPorts().values().iterator().next();
            }
        }
       
        QName serviceName = getServiceName(ref);
        if (null != serviceName) {
            Service service = def.getService(serviceName);
            if (service == null) {
                throw new WSDLException(WSDLException.OTHER_ERROR, "Cannot find service for " + serviceName);
            }
            if (service.getPorts().size() == 1) {
                return (Port)service.getPorts().values().iterator().next();
            }
            String str = getPortName(ref);
            LOG.log(Level.FINE, "getting port " + str + " from service " + service.getQName());
            Port port = service.getPort(str);
            if (port == null) {
                throw new WSDLException(WSDLException.OTHER_ERROR, "unable to find port " + str);
            }
            return port;
        }
View Full Code Here

            generator.addInterfaceName("BasePortType");

            Definition model = generator.generateCORBABinding();               
            QName name = new QName("http://schemas.apache.org/idl/datetime.idl",
                                     "BaseCORBAService", "tns");
            Service service = model.getService(name);
            Port port = service.getPort("BaseCORBAPort");
            AddressType addressType = (AddressType)port.getExtensibilityElements().get(0);
            String address = addressType.getLocation();
            assertEquals("file:./Base.ref", address);           
           
            generator.setAddress("corbaloc::localhost:40000/hw");
            model = generator.generateCORBABinding();
            service = model.getService(name);
            port = service.getPort("BaseCORBAPort");
            addressType = (AddressType)port.getExtensibilityElements().get(0);
            address = addressType.getLocation();
            assertEquals("corbaloc::localhost:40000/hw", address);
        } finally {
            new File("datetime-corba.wsdl").deleteOnExit();
View Full Code Here

            generator.addInterfaceName("BasePortType");

            Definition model = generator.generateCORBABinding();               
            QName name = new QName("http://schemas.apache.org/idl/datetime.idl",
                                     "BaseCORBAService", "tns");
            Service service = model.getService(name);
            Port port = service.getPort("BaseCORBAPort");
            AddressType addressType = (AddressType)port.getExtensibilityElements().get(0);
            String address = addressType.getLocation();
            assertEquals("file:./Base.ref", address);           
           
            URL idl = getClass().getResource("/wsdl/addressfile.txt");
            String filename = new File(idl.toURI()).getAbsolutePath();
            generator.setAddressFile(filename);
            model = generator.generateCORBABinding();
            service = model.getService(name);
            port = service.getPort("BaseCORBAPort");
            addressType = (AddressType)port.getExtensibilityElements().get(0);
            address = addressType.getLocation();
            assertEquals("corbaloc::localhost:60000/hw", address);
        } finally {
            new File("datetime-corba.wsdl").deleteOnExit();
View Full Code Here

TOP

Related Classes of javax.wsdl.Service

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.