Package javax.wsdl

Examples of javax.wsdl.Port


    }
   
    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


                .getEndpointReference(manager, implementor);

        Definition def = EndpointReferenceUtils.getWSDLDefinition(manager, ref);
        assertNotNull("Could not generate wsdl", def);

        Port port = EndpointReferenceUtils.getPort(bus.getWSDLManager(), ref);
        // FIXME - a soap binding and service/port should have been
        // generated
        // negative test case
        // fail("Did not expect a port to be found. Did someone fix this?");
View Full Code Here

        EndpointReferenceType ref = EndpointReferenceUtils
                .getEndpointReference(manager, implementor);
        Definition def = EndpointReferenceUtils.getWSDLDefinition(manager, ref);
        assertNotNull("Could not load wsdl", def);
       
        Port port = EndpointReferenceUtils.getPort(bus.getWSDLManager(), ref);

        assertNull("Port should not be present in the reference.", port);
       
        bus.shutdown(true);
       
View Full Code Here

        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        reader.setFeature("javax.wsdl.verbose", false);
        InputSource input = new InputSource(url.openStream());
        Definition def = reader.readWSDL(null, input);
        Port port = def.getService(new QName("http://objectweb.org/hello_world_rpclit",
                                             "SOAPServiceRPCLit1")).getPort("SoapPortRPCLit1");
        WSDLMetaDataCache wsdl = new WSDLMetaDataCache(def, port);
       
        for (Method method : cls.getDeclaredMethods()) {
            DataBindingCallback c1 = new JAXBDataBindingCallback(method, Mode.PARTS, ctx);
View Full Code Here

        EndpointReferenceType ref =
            EndpointReferenceUtils.getEndpointReference(neturl, serviceName, "");

        assertNotNull("Unable to create EndpointReference ", ref);

        Port port = EndpointReferenceUtils.getPort(wsdlManager, ref);
        List<?> list = port.getExtensibilityElements();
        JMSAddressPolicyType jmsAddressDetails = null;
        for (Object ep : list) {
            ExtensibilityElement ext = (ExtensibilityElement)ep;
            if (ext instanceof JMSAddressPolicyType) {
                jmsAddressDetails = (JMSAddressPolicyType)ext;
View Full Code Here

        Configuration portCfg = null;
        String id = portName.getLocalPart();
        ConfigurationBuilder cb = ConfigurationBuilderFactory.getBuilder(null);
        portCfg = cb.buildConfiguration(PORT_CONFIGURATION_URI, id, bus.getConfiguration());
       
        Port port = EndpointReferenceUtils.getPort(bus.getWSDLManager(), ref);
        assertNotNull(port);
        portCfg.getProviders().add(new WsdlPortProvider(port));
        return portCfg;
    }
View Full Code Here

        Definition def = EndpointReferenceUtils.getWSDLDefinition(manager,
                                                                  ref);
        assertNotNull("Could not load wsdl", def);


        Port port = EndpointReferenceUtils.getPort(manager, ref);
        assertNotNull("Could not find port", port);            
    }
View Full Code Here

        Definition def = EndpointReferenceUtils.getWSDLDefinition(manager,
                                                                  ref);
        assertNotNull("Could not load wsdl", def);


        Port port = EndpointReferenceUtils.getPort(manager, ref);
        assertNotNull("Could not find port", port);            
    }
View Full Code Here

        EndpointReferenceType ref =
            EndpointReferenceUtils.getEndpointReference(url, serviceName, portName);

        assertNotNull("Could not create endpoint reference", ref);

        Port port = EndpointReferenceUtils.getPort(manager, ref);

        assertNotNull("Could not find port", port);       
        assertEquals(portName, port.getName());
   
View Full Code Here

           
            if (obj instanceof JAXBElement) {
                Object jaxbVal = ((JAXBElement)obj).getValue();

                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

TOP

Related Classes of javax.wsdl.Port

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.