Search in sources :

Example 6 with AddressType

use of org.apache.cxf.binding.corba.wsdl.AddressType in project cxf by apache.

the class WSDLToCorbaBindingTypeTest method testSetCorbaAddressFile.

@Test
public void testSetCorbaAddressFile() throws Exception {
    try {
        URI fileName = getClass().getResource("/wsdl/datetime.wsdl").toURI();
        generator.setWsdlFile(new File(fileName).getAbsolutePath());
        generator.addInterfaceName("BasePortType");
        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();
    }
}
Also used : QName(javax.xml.namespace.QName) Port(javax.wsdl.Port) Definition(javax.wsdl.Definition) Service(javax.wsdl.Service) AddressType(org.apache.cxf.binding.corba.wsdl.AddressType) URI(java.net.URI) File(java.io.File) URL(java.net.URL) Test(org.junit.Test)

Aggregations

AddressType (org.apache.cxf.binding.corba.wsdl.AddressType)6 File (java.io.File)4 Port (javax.wsdl.Port)4 Service (javax.wsdl.Service)4 QName (javax.xml.namespace.QName)4 BufferedReader (java.io.BufferedReader)2 FileReader (java.io.FileReader)2 IOException (java.io.IOException)2 Definition (javax.wsdl.Definition)2 ToolException (org.apache.cxf.tools.common.ToolException)2 Test (org.junit.Test)2 FileNotFoundException (java.io.FileNotFoundException)1 URI (java.net.URI)1 URL (java.net.URL)1 HashMap (java.util.HashMap)1 WSDLException (javax.wsdl.WSDLException)1 CorbaDSIServant (org.apache.cxf.binding.corba.runtime.CorbaDSIServant)1 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)1 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)1 Servant (org.omg.PortableServer.Servant)1