Package javax.wsdl

Examples of javax.wsdl.Binding


//TODO  resolve this
//    this code support only the service with onebindings it will not care about the
//    second binding if exists.. if the NO binding specified it will failed
//    this should be resolved by let user specify which binding to use.

    Binding binding = null;
    if (ports.hasNext())
      binding = ((Port) ports.next()).getBinding();
    if (binding == null)
      throw new WrapperFault("No binding specified");
    this.bindingEntry = symbolTable.getBindingEntry(binding.getQName());
   
    this.portTypeEntry = symbolTable.getPortTypeEntry(binding.getPortType().getQName());
    if (portTypeEntry == null)
      throw new WrapperFault("Service not found");
    ports = this.serviceentry.getService().getPorts().values().iterator();
    this.targetEndpointURI = SymbolTableParsingUtils.getTargetEndPointURI(ports);     
    }
View Full Code Here


                GerPortType port = portCompletion.getPort();
                URL location = getLocation(port);
                String portName = port.getPortName().trim();
                String bindingName = portCompletion.getBindingName().trim();
                QName bindingQName = new QName(namespace, bindingName);
                Binding binding = definition.getBinding(bindingQName);
                if (binding == null) {
                    throw new DeploymentException("No binding found with qname: " + bindingQName);
                }
                String credentialsName = port.isSetCredentialsName() ? port.getCredentialsName().trim() : null;
                mapBinding(binding, mapping, serviceQName, classLoader, soapVersion, schemaInfoBuilder, portName, location, handlerInfos, seiPortNameToFactoryMap, seiClassNameToFactoryMap, credentialsName, exceptionMap);

            }
        } else {
            //full wsdl
            if (serviceRefType != null && serviceRefType.isSetServiceCompletion()) {
                throw new DeploymentException("Full wsdl, but service completion supplied");
            }
            //organize the extra port info
            Map portMap = new HashMap();
            if (serviceRefType != null) {
                GerPortType[] ports = serviceRefType.getPortArray();
                for (int i = 0; i < ports.length; i++) {
                    GerPortType port = ports[i];
                    String portName = port.getPortName().trim();
                    portMap.put(portName, port);
                }
            }

            //find the service we are working with
            javax.wsdl.Service service = getService(serviceQName, schemaInfoBuilder.getDefinition());
            if (serviceQName == null) {
                serviceQName = service.getQName();
            }

            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 (location == null) {
                    continue;
                }
                String credentialsName = (gerPort == null) ? null : getCredentialsName(gerPort);
               
                Binding binding = port.getBinding();
                if (binding == null) {
                    throw new DeploymentException("No binding for port: " + portName);
                }
               
                PortType portType = binding.getPortType();
                if (portType == null) {
                    throw new DeploymentException("No portType for binding: " + binding.getQName());
                }

                boolean mtomEnabled = isMTOMEnabled(portType.getQName());
               
                EndpointInfo info = new EndpointInfo(location, credentialsName, mtomEnabled);
View Full Code Here

                GerPortType port = portCompletion.getPort();
                URL location = getLocation(port);
                String portName = port.getPortName().trim();
                String bindingName = portCompletion.getBindingName().trim();
                QName bindingQName = new QName(namespace, bindingName);
                Binding binding = definition.getBinding(bindingQName);
                if (binding == null) {
                    throw new DeploymentException("No binding found with qname: " + bindingQName);
                }
                String credentialsName = port.isSetCredentialsName() ? port.getCredentialsName().trim() : null;
                mapBinding(binding, mapping, serviceQName, classLoader, soapVersion, schemaInfoBuilder, portName, location, handlerInfos, seiPortNameToFactoryMap, seiClassNameToFactoryMap, credentialsName, exceptionMap);

            }
        } else {
            //full wsdl
            if (serviceRefType != null && serviceRefType.isSetServiceCompletion()) {
                throw new DeploymentException("Full wsdl, but service completion supplied");
            }
            //organize the extra port info
            Map portMap = new HashMap();
            if (serviceRefType != null) {
                GerPortType[] ports = serviceRefType.getPortArray();
                for (int i = 0; i < ports.length; i++) {
                    GerPortType port = ports[i];
                    String portName = port.getPortName().trim();
                    portMap.put(portName, port);
                }
            }

            //find the service we are working with
            javax.wsdl.Service service = getService(serviceQName, schemaInfoBuilder.getDefinition());
            if (serviceQName == null) {
                serviceQName = service.getQName();
            }

            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

                                break;
                            }
                        }
                        WSDLFactory factory = WSDLFactory.newInstance();
                        ExtensionRegistry extReg = factory.newPopulatedExtensionRegistry();
                        Binding binding = PartialWSDLProcessor.doAppendBinding(definition,
                                                                               existPortName, portType, extReg);
                        definition.addBinding(binding);
                        wsdlService = PartialWSDLProcessor.doAppendService(definition,
                                                                           existPortName, extReg, binding);
                        definition.addService(wsdlService);
View Full Code Here

                PortType portType = def.getPortType((QName)entry.getKey());
                ServiceInfo serviceInfo = this.buildMockService(def, portType);
                serviceList.add(serviceInfo);

                for (Iterator<?> it2 = d.getAllBindings().values().iterator(); it2.hasNext();) {
                    Binding b = (Binding)it2.next();
                    if (b.getPortType() == portType) {
                        this.buildBinding(serviceInfo, b);
                        break;
                    }
                }
            }
View Full Code Here

        for (Port port : cast(serv.getPorts().values(), Port.class)) {
            if (endpointName != null
                && !endpointName.getLocalPart().equals(port.getName())) {
                continue;
            }
            Binding binding = port.getBinding();
            PortType bindingPt = binding.getPortType();
            if (bindingPt == null) {
                org.apache.cxf.common.i18n.Message msg = new
                org.apache.cxf.common.i18n.Message("BINDING_MISSING_TYPE",
                                                   LOG,
                                                   binding.getQName());
                throw new WSDLRuntimeException(msg);
            }

            //TODO: wsdl4j's bug. if there is recursive import,
            //wsdl4j can not get operation input message
            PortType pt = def.getPortType(bindingPt.getQName());
            if (pt == null) {
                pt = bindingPt;
            }
            ServiceInfo service = services.get(pt.getQName());
            if (service == null) {
                service = new ServiceInfo();
                service.setDescription(description);
                description.getDescribed().add(service);
                if (recordOriginal) {
                    service.setProperty(WSDL_DEFINITION, def);
                    service.setProperty(WSDL_SERVICE, serv);
                }
                getSchemas(def, service);
                copyDocumentation(service, serv);
                service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);
                service.setTargetNamespace(def.getTargetNamespace());
                service.setName(serv.getQName());
                copyExtensors(service, serv.getExtensibilityElements());
                copyExtensionAttributes(service, serv);

                buildInterface(service, pt);

                services.put(pt.getQName(), service);
            }

            BindingInfo bi = service.getBinding(binding.getQName());
            if (bi == null) {
                bi = buildBinding(service, binding);
            }
            buildEndpoint(service, bi, port);
        }
View Full Code Here

        if (operationName == null) {
            return null;
        }
        Iterator ite = def.getBindings().values().iterator();
        while (ite.hasNext()) {
            Binding binding = (Binding)ite.next();
            Iterator ite1 = binding.getBindingOperations().iterator();
            while (ite1.hasNext()) {
                BindingOperation bop = (BindingOperation)ite1.next();
                if (bop.getName().equals(operationName)) {
                    return bop;
                }
View Full Code Here

    }

    public Binding getBinding(BindingOperation bop, Definition def) {
        Iterator ite = def.getBindings().values().iterator();
        while (ite.hasNext()) {
            Binding binding = (Binding)ite.next();
            for (Iterator ite2 = binding.getBindingOperations().iterator(); ite2.hasNext();) {
                BindingOperation bindingOperation = (BindingOperation)ite2.next();
                if (bindingOperation.getName().equals(bop.getName())) {
                    return binding;
                }
            }
View Full Code Here

                PortType portType = def.getPortType((QName)entry.getKey());
                ServiceInfo serviceInfo = this.buildMockService(def, portType);
                serviceList.add(serviceInfo);
               
                for (Iterator it2 = d.getAllBindings().values().iterator(); it2.hasNext();) {
                    Binding b = (Binding)it2.next();
                    if (b.getPortType() == portType) {
                        this.buildBinding(serviceInfo, b);
                        break;
                    }
                }
            }
View Full Code Here

TOP

Related Classes of javax.wsdl.Binding

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.