Package org.apache.cxf.binding.corba.wsdl

Examples of org.apache.cxf.binding.corba.wsdl.AddressType


            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


            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

        Port servicePort = def.createPort();
        servicePort.setName(portName);
        servicePort.setBinding(binding);

        try {
            AddressType addressType =
                (AddressType) def.getExtensionRegistry().createExtension(Port.class,
                                                                         CorbaConstants.NE_CORBA_ADDRESS);
           
            String addr = null;
            if (getAddressFile() != null) {
                try {
                    File addrFile = new File(getAddressFile());
                    FileReader fileReader = new FileReader(addrFile);
                    BufferedReader bufferedReader = new BufferedReader(fileReader);
                    addr = bufferedReader.readLine();
                } catch (Exception ex) {
                    throw new ToolException(ex.getMessage(), ex);
                }
            } else {
                addr = getAddress();
            }
            if (addr == null) {
                addr = "file:./" + interfaceName + ".ref";           
            }
            addressType.setLocation(addr);
            servicePort.addExtensibilityElement(addressType);
        } catch (WSDLException ex) {
            throw new Exception("Failed to create CORBA address for service", ex);
        }
       
View Full Code Here

                    def.addService(service);
                }
            }
            Port port = def.createPort();
            port.setName(portTypeName.getLocalPart() + "CORBAPort");
            AddressType address =
                (AddressType) def.getExtensionRegistry().createExtension(Port.class,
                                                                         CorbaConstants.NE_CORBA_ADDRESS);
           
            String addr = null;
            String addrFileName = (String) env.get(ToolCorbaConstants.CFG_ADDRESSFILE);
            if (addrFileName != null) {
                try {
                    File addrFile = new File(addrFileName);
                    FileReader fileReader = new FileReader(addrFile);
                    BufferedReader bufferedReader = new BufferedReader(fileReader);
                    addr = bufferedReader.readLine();
                } catch (Exception ex) {
                    throw new ToolException(ex.getMessage(), ex);
                }
            } else {
                addr = (String) env.get(ToolCorbaConstants.CFG_ADDRESS);
            }
            if (addr == null) {
                addr = "IOR:";
            }
            address.setLocation(addr);
            port.addExtensibilityElement(address);
            service.addPort(port);
            port.setBinding(bindings[i]);
        }
    }
View Full Code Here

        Port servicePort = def.createPort();
        servicePort.setName(portName);
        servicePort.setBinding(binding);

        try {
            AddressType addressType =
                (AddressType) def.getExtensionRegistry().createExtension(Port.class,
                                                                         CorbaConstants.NE_CORBA_ADDRESS);

            String addr = null;
            if (getAddressFile() != null) {
                try {
                    File addrFile = new File(getAddressFile());
                    FileReader fileReader = new FileReader(addrFile);
                    BufferedReader bufferedReader = new BufferedReader(fileReader);
                    addr = bufferedReader.readLine();
                } catch (Exception ex) {
                    throw new ToolException(ex.getMessage(), ex);
                }
            } else {
                addr = getAddress();
            }
            if (addr == null) {
                addr = "file:./" + interfaceName + ".ref";
            }
            addressType.setLocation(addr);
            servicePort.addExtensibilityElement(addressType);
        } catch (WSDLException ex) {
            throw new Exception("Failed to create CORBA address for service", ex);
        }
View Full Code Here

            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

            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

        }
    }
    public void prepare(Message message) throws IOException {   
        try {
            prepareOrb();
            AddressType address = endpointInfo.getExtensor(AddressType.class);

            if (address == null) {
                LOG.log(Level.SEVERE, "Unable to locate a valid CORBA address");
                throw new CorbaBindingException("Unable to locate a valid CORBA address");
            }
            String ref = (String)message.get(Message.ENDPOINT_ADDRESS);
            org.omg.CORBA.Object targetObject;
            // A non-null endpoint address from the message means that we want to invoke on a particular
            // object reference specified by the endpoint reference type.  If the reference is null, then
            // we want to invoke on the default location as specified in the WSDL.
            if (ref != null) {
                targetObject = CorbaUtils.importObjectReference(orb, ref);
            } else {
                targetObject = CorbaUtils.importObjectReference(orb, address.getLocation());
            }
            message.put(CorbaConstants.ORB, orb);
            message.put(CorbaConstants.CORBA_ENDPOINT_OBJECT, targetObject);
            message.setContent(OutputStream.class,
                               new CorbaOutputStream(message));
View Full Code Here

        Port servicePort = def.createPort();
        servicePort.setName(portName);
        servicePort.setBinding(binding);

        try {
            AddressType addressType =
                (AddressType) def.getExtensionRegistry().createExtension(Port.class,
                                                                         CorbaConstants.NE_CORBA_ADDRESS);
           
            String addr = null;
            if (getAddressFile() != null) {
                try {
                    File addrFile = new File(getAddressFile());
                    FileReader fileReader = new FileReader(addrFile);
                    BufferedReader bufferedReader = new BufferedReader(fileReader);
                    addr = bufferedReader.readLine();
                } catch (Exception ex) {
                    throw new ToolException(ex.getMessage(), ex);
                }
            } else {
                addr = getAddress();
            }
            if (addr == null) {
                addr = "file:./" + interfaceName + ".ref";           
            }
            addressType.setLocation(addr);
            servicePort.addExtensibilityElement(addressType);
        } catch (WSDLException ex) {
            throw new Exception("Failed to create CORBA address for service", ex);
        }
       
View Full Code Here

            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

TOP

Related Classes of org.apache.cxf.binding.corba.wsdl.AddressType

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.