Package javax.wsdl

Examples of javax.wsdl.Port


                    servletLocation = (String) servletLocations.get(linkName);
                    servletLocation = schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                }
                PortComponentHandlerType[] handlers = portComponent.getHandlerArray();

                Port port = (Port) wsdlPortMap.get(portQName.getLocalPart());
                if (port == null) {
                    throw new DeploymentException("No WSDL Port definition for port-component " + portComponentName);
                }

                ServiceEndpointInterfaceMappingType seiMapping = (ServiceEndpointInterfaceMappingType) seiMappings.get(seiInterfaceName);
View Full Code Here


            Map wsdlPortMap = service.getPorts();
            for (Iterator iterator = wsdlPortMap.entrySet().iterator(); iterator.hasNext();) {
                Map.Entry entry = (Map.Entry) iterator.next();
                String portName = (String) entry.getKey();
                Port port = (Port) entry.getValue();

                GerPortType gerPort = (GerPortType) portMap.get(portName);

                URL location = gerPort == null ? getAddressLocation(port) : getLocation(gerPort);
                //skip non-soap ports
                if (location == null) {
                    continue;
                }
                String credentialsName = gerPort == null || gerPort.getCredentialsName() == null ? null : gerPort.getCredentialsName().trim();

                Binding binding = port.getBinding();

                mapBinding(binding, mapping, serviceQName, classLoader, soapVersion, schemaInfoBuilder, portName, location, handlerInfos, seiPortNameToFactoryMap, seiClassNameToFactoryMap, credentialsName, exceptionMap);
            }
        }
    }
View Full Code Here

        if (service.getPorts().values().size() == 0) {
            throw new ToolException("Service " + service.getQName() + " does not contain any usable ports");
        }
        Iterator portIte = service.getPorts().values().iterator();
        while (portIte.hasNext()) {
            Port port = (Port)portIte.next();
            Binding binding = port.getBinding();
            bindings.put(binding.getQName(), getXNode(service, port));
            if (WSDLConstants.WSDL11_NAMESPACE.equals(binding.getQName().getNamespaceURI())) {
                throw new ToolException("Binding "
                                        + binding.getQName().getLocalPart()
                                        + " namespace set improperly.");
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.getValue().getLocalPart());
                    Service service = def.getService(snt.getValue());
                    if (service == null) {
                        LOG.log(Level.WARNING, "can't find the service name ["
                                + snt.getValue()
                                + "], using the default service name in wsdl");
                        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) {
                        LOG.log(Level.WARNING, "can't find the port name ["
                                + endpoint
                                + "], using the default port name in wsdl");
                        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

        wsdlReader.setFeature("javax.wsdl.importDocuments", true);

        Definition definition = wsdlReader.readWSDL("http://localhost:8085/AccountService?wsdl");
        assertNotNull(definition);
        Service service = definition.getService(new QName("http://accounts/AccountService/Account", "Account"));
        Port port = service.getPort("AccountSOAP11Port");

        String endpoint = getEndpoint(port);
        assertEquals("http://localhost:8085/AccountService", endpoint);
    }
View Full Code Here

        Definition definition = wsdlReader.readWSDL("http://localhost:8085/services/HelloWorldWebService2?wsdl");
        assertNotNull(definition);
        Service service = definition.getService(new QName("http://helloworld/HelloWorldService/HelloWorld",
                                                 "HelloWorld"));       
        Port port = service.getPort("ep2SOAP11Port");

        String endpoint = getEndpoint(port);
        assertEquals("http://localhost:8085/services/HelloWorldWebService2", endpoint);
    }
View Full Code Here

        Definition definition = wsdlReader.readWSDL("http://localhost:8085/foo/bar?wsdl");
        assertNotNull(definition);
        Service service = definition.getService(new QName("http://axis2.ws.binding.sca.tuscany.apache.org/",
                                                          "HelloWorld"));
        Port port = service.getPort("ep1SOAP11Port");

        String endpoint = getEndpoint(port);
        // TODO - used to get the real host here but WSDL seems to have localhost in it atm?
        assertEquals("http://localhost:8085/foo/bar", endpoint);
    }
View Full Code Here

        wsdlReader.setFeature("javax.wsdl.importDocuments", true);

        Definition definition = wsdlReader.readWSDL("http://localhost:8086/AccountService?wsdl");
        assertNotNull(definition);
        Service service = definition.getService(new QName("http://account2/AccountService/Account", "Account"));
        Port port = service.getPort("AccountSOAP11Port");

        String endpoint = getEndpoint(port);
       // String ip = HttpUtils.getIpAddress();
        assertEquals("http://localhost:8086/AccountService", endpoint);
    }
View Full Code Here

      
        Definition def = wsBinding.getGeneratedWSDLDocument();
        TestUtils.writeWSDL(def);
       
        javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service2"));
        Port port = svc.getPort("Service2SOAP11Port");
        Assert.assertEquals("/ComponentB/Service2",TestUtils.getPortAddress(port));
    
    }
View Full Code Here

    public void testWriteWrapper() throws Exception {
        WSDLReader wreader =  WSDLFactory.newInstance().newWSDLReader();
        wreader.setFeature("javax.wsdl.verbose", false);
        URL url = getClass().getResource("/wsdl/hello_world.wsdl");
        Definition definition = wreader.readWSDL(url.toString());
        Port port = definition.getService(new QName("http://objectweb.org/hello_world_soap_http",
                                                    "SOAPService")).getPort("SoapPort");
       
        WSDLMetaDataCache wsdlCache = new WSDLMetaDataCache(definition,
                                                            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.