Package javax.wsdl

Examples of javax.wsdl.Binding


    protected static boolean queryBinding(Definition definition, QName bqname) {
        Map bindings = definition.getBindings();
        Iterator i = bindings.values().iterator();
        while (i.hasNext()) {
            Binding binding = (Binding)i.next();
            if (binding.getQName().getLocalPart().equals(bqname.getLocalPart())) {
                return true;
            }
        }
        return false;
    }
View Full Code Here


                    if ("corba:binding=".equals(info.substring(0, 14))) {
                        String bindingName = info.substring(14);
                        QName bqname = new QName(definition.getTargetNamespace(), bindingName);

                        //Check if the Binding with name already exists
                        Binding binding = null;
                        if (WSDLToCorbaHelper.queryBinding(definition, bqname)) {
                            binding = definition.getBinding(bqname);
                        }

                        if (binding != null) {   
                            org.apache.schemas.yoko.bindings.corba.Object obj =
                                new org.apache.schemas.yoko.bindings.corba.Object();
                            PortType portT = binding.getPortType();
                            QName name = new QName(idlNamespace, portT.getQName().getLocalPart(),
                                                   definition.getPrefix(idlNamespace));
                            obj.setName(name.getLocalPart());
                            obj.setQName(name)
                            QName bName = binding.getQName();                          
                            obj.setBinding(bName);
                            // get the repository id of the binding.
                            String repId = null;
                            Iterator bindIter = binding.getExtensibilityElements().iterator();
                            while (bindIter.hasNext()) {
                                BindingType type = (BindingType)bindIter.next();
                                repId = type.getRepositoryID();                              
                            }
                            obj.setRepositoryID(repId);
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

    }
   
    public static Binding getDefaultBinding(org.omg.CORBA.Object obj, Definition wsdlDef) {
        Collection bindings = wsdlDef.getBindings().values();
        for (Iterator iter = bindings.iterator(); iter.hasNext();) {
            Binding b = (Binding)iter.next();
            List extElements = b.getExtensibilityElements();
           
            // Get the list of all extensibility elements
            for (Iterator extIter = extElements.iterator(); extIter.hasNext();) {
                Object element = extIter.next();
View Full Code Here

        if (pfx == null) {
            pfx = new String("corba");
            def.addNamespace(pfx, CorbaConstants.NU_WSDL_CORBA);
        }

        Binding binding = null;
        binding = def.createBinding();
        binding.setPortType(portType);
        binding.setQName(bqname);

        bindingNames.add(bname);
        mapBindingToInterface(portType.getQName().getLocalPart(), bname);
        BindingType bindingType = null;
       
        addCorbaTypeMap(def);
       
        try {
            bindingType = (BindingType)extReg
                .createExtension(Binding.class, CorbaConstants.NE_CORBA_BINDING);
            bindingType.setRepositoryID(helper.REPO_STRING
                                        + binding.getPortType().getQName().getLocalPart().replace('.', '/')
                                        + helper.IDL_VERSION);

            binding.addExtensibilityElement(bindingType);
        } catch (WSDLException ex) {
            ex.printStackTrace();
        }

        try {
            addBindingOperations(def, portType, binding);       
            binding.setUndefined(false);
            definition.addBinding(binding);           
        } catch (Exception ex) {
            ex.printStackTrace();
        }
       
View Full Code Here

        // This is specified in the schema definition for a custom endpoint
        // reference type.
        Collection bindings = wsdlDefinition.getBindings().values();
       
        for (Iterator iter = bindings.iterator(); iter.hasNext();) {
            Binding b = (Binding)iter.next();
            List extElements = b.getExtensibilityElements();
           
            for (Iterator extIter = extElements.iterator(); extIter.hasNext();) {
                java.lang.Object element = extIter.next();
               
                if (element instanceof BindingType) {
                    BindingType bt = (BindingType)element;
                    if (bt.getRepositoryID().equals(repositoryID)) {
                        return b.getQName();   
                    }
                }
            }
        }
       
View Full Code Here

        // endpoint reference type we are about to create.
        org.apache.schemas.yoko.bindings.corba.Object refObject =
            (org.apache.schemas.yoko.bindings.corba.Object)objRefHandler.getType();
        Definition wsdlDef = (Definition)serviceInfo.getProperty(WSDLServiceBuilder.WSDL_DEFINITION);
        QName bindingName = refObject.getBinding();
        Binding wsdlBinding = null;
        if (bindingName != null) {
            wsdlBinding = wsdlDef.getBinding(bindingName);
        } else {
            // TODO: Revisit: We are doing this for default object references to obtain the binding
            // that defines the object.  Is this the correct thing to do or do we not even try to
            // find a binding since the information is not provided by the typemapping object?
            wsdlBinding = CorbaObjectReferenceHelper.getDefaultBinding(corbaObject, wsdlDef);
        }

        QName interfaceName = null;
        QName referenceName = null;
        if (wsdlBinding != null) {
            interfaceName = wsdlBinding.getPortType().getQName();
            referenceName = new QName(interfaceName.getLocalPart() + "Ref");
        } else {
            referenceName = new QName("CORBA.Object");
        }
       
View Full Code Here

    public Binding[] getCorbaBindings() {
        List<Binding> result = new ArrayList<Binding>();
        Map bindings = definition.getBindings();
        Iterator it = bindings.values().iterator();
        while (it.hasNext()) {
            Binding binding = (Binding) it.next();
            List extElements = binding.getExtensibilityElements();
            for (int i = 0; i < extElements.size(); i++) {
                ExtensibilityElement el = (ExtensibilityElement) extElements.get(i);
                if (el.getElementType().equals(CorbaConstants.NE_CORBA_BINDING)) {
                    result.add(binding);
                    break;
View Full Code Here

       
        portType = definition.createPortType();
        portType.setQName(new QName(definition.getTargetNamespace(), interfaceScope.toString()));
        portType.setUndefined(false);
        definition.addPortType(portType);
        Binding binding = createBinding();
       
        AST exportNode = identifierNode.getNextSibling();
        while (exportNode != null) {
           
            if (TypeDclVisitor.accept(exportNode)) {
View Full Code Here

        int count = 0;
        while (queryBinding(bqname)) {
            bname = bname + count;
            bqname = new QName(definition.getTargetNamespace(), bname);
        }
        Binding binding = definition.createBinding();
        binding.setPortType(portType);
        binding.setQName(bqname);

        try {
            BindingType bindingType = (BindingType)
                extReg.createExtension(Binding.class, CorbaConstants.NE_CORBA_BINDING);
            bindingType.setRepositoryID(CorbaConstants.REPO_STRING
                                        + portType.getQName().getLocalPart().replace('.', '/')
                                        + CorbaConstants.IDL_VERSION);
            binding.addExtensibilityElement(bindingType);
        } catch (WSDLException ex) {
            throw new RuntimeException(ex);
        }
        binding.setUndefined(false);
        definition.addBinding(binding);
        return binding;
    }
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.