You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2007/04/13 00:22:55 UTC

svn commit: r528260 [2/2] - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/service/ api/src/main/java/org/apache/cxf/service/model/ rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ rt/bindings/http/src/main/java/org/apache/cxf/b...

Modified: incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/AbstractJMSTester.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/AbstractJMSTester.java?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/AbstractJMSTester.java (original)
+++ incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/AbstractJMSTester.java Thu Apr 12 15:22:52 2007
@@ -83,7 +83,7 @@
         WSDLServiceFactory factory = new WSDLServiceFactory(bus, wsdlUrl, new QName(ns, serviceName));
 
         Service service = factory.create();        
-        endpointInfo = service.getServiceInfo().getEndpoint(new QName(ns, portName));
+        endpointInfo = service.getEndpointInfo(new QName(ns, portName));
    
     }
     

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java Thu Apr 12 15:22:52 2007
@@ -70,13 +70,13 @@
             return;
         }
         
-        OperationInfo oi = reliableEndpoint.getService().getServiceInfo().getInterface()
+        OperationInfo oi = reliableEndpoint.getEndpoint().getEndpointInfo().getService().getInterface()
             .getOperation(RMConstants.getSequenceAckOperationName());
         invoke(oi, new Object[] {}, null);
     }
     
     void terminate(SourceSequence ss) throws IOException {
-        OperationInfo oi = reliableEndpoint.getService().getServiceInfo().getInterface()
+        OperationInfo oi = reliableEndpoint.getEndpoint().getEndpointInfo().getService().getInterface()
             .getOperation(RMConstants.getTerminateSequenceOperationName());
         
         TerminateSequenceType ts = RMUtils.getWSRMFactory().createTerminateSequenceType();
@@ -86,7 +86,7 @@
     
     void createSequenceResponse(final CreateSequenceResponseType createResponse) {
         LOG.fine("sending CreateSequenceResponse from client side");
-        final OperationInfo oi = reliableEndpoint.getService().getServiceInfo().getInterface()
+        final OperationInfo oi = reliableEndpoint.getEndpoint().getEndpointInfo().getService().getInterface()
             .getOperation(RMConstants.getCreateSequenceResponseOnewayOperationName());
         
         // TODO: need to set relatesTo
@@ -132,7 +132,7 @@
             setOfferedIdentifier(offer);
         }
         
-        InterfaceInfo ii = reliableEndpoint.getService().getServiceInfo().getInterface();
+        InterfaceInfo ii = reliableEndpoint.getEndpoint().getEndpointInfo().getService().getInterface();
         
         final OperationInfo oi = isServer 
             ? ii.getOperation(RMConstants.getCreateSequenceOnewayOperationName())

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/WrappedService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/WrappedService.java?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/WrappedService.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/WrappedService.java Thu Apr 12 15:22:52 2007
@@ -33,6 +33,7 @@
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.invoker.Invoker;
+import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 
 /**
@@ -43,14 +44,14 @@
     private Service wrappedService;
     private DataBinding dataBinding;
     private QName name;
-    private ServiceInfo serviceInfo;
+    private List<ServiceInfo> serviceInfos;
     private Map<QName, Endpoint> endpoints;
     private Invoker invoker;
     
     WrappedService(Service wrapped, QName n, ServiceInfo info) {
         wrappedService = wrapped;
         name = n;
-        serviceInfo = info;
+        serviceInfos = Collections.singletonList(info);
     }
     
     public Service getWrappedService() {
@@ -65,8 +66,11 @@
         return name;
     }
 
+    public List<ServiceInfo> getServiceInfos() {
+        return serviceInfos;
+    }
     public ServiceInfo getServiceInfo() {
-        return serviceInfo;
+        return serviceInfos.get(0);
     }
 
     public void setDataBinding(DataBinding arg0) {
@@ -162,5 +166,10 @@
     void setEndpoint(Endpoint e) {
         endpoints = Collections.singletonMap(e.getEndpointInfo().getName(), e);
     }
+
+    public EndpointInfo getEndpointInfo(QName endpoint) {
+        return serviceInfos.get(0).getEndpoint(endpoint);
+    }
+
 
 }

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java Thu Apr 12 15:22:52 2007
@@ -30,7 +30,6 @@
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.jaxb.DatatypeFactory;
-import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -116,16 +115,19 @@
         EasyMock.expect(acksToEPR.getAddress()).andReturn(acksToURI);
         String acksToAddress = "acksTo";
         EasyMock.expect(acksToURI.getValue()).andReturn(acksToAddress);
-        Service service = control.createMock(Service.class);
-        EasyMock.expect(rme.getService()).andReturn(service);
+        Endpoint endpoint = control.createMock(Endpoint.class);
+        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint);
+        EndpointInfo epi = control.createMock(EndpointInfo.class);
+        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);
         ServiceInfo si = control.createMock(ServiceInfo.class);
-        EasyMock.expect(service.getServiceInfo()).andReturn(si);
+        EasyMock.expect(epi.getService()).andReturn(si);
         InterfaceInfo ii = control.createMock(InterfaceInfo.class);
         EasyMock.expect(si.getInterface()).andReturn(ii);
         OperationInfo oi = control.createMock(OperationInfo.class);
         EasyMock.expect(ii.getOperation(RMConstants.getSequenceAckOperationName())).andReturn(oi);
         expectInvoke(proxy, oi, null);
         control.replay();
+        
         proxy.acknowledge(ds);      
     }
     
@@ -135,10 +137,12 @@
             new Class[] {OperationInfo.class, Object[].class, Map.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
         proxy.setReliableEndpoint(rme);        
-        Service service = control.createMock(Service.class);
-        EasyMock.expect(rme.getService()).andReturn(service);
+        Endpoint endpoint = control.createMock(Endpoint.class);
+        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint);
+        EndpointInfo epi = control.createMock(EndpointInfo.class);
+        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);
         ServiceInfo si = control.createMock(ServiceInfo.class);
-        EasyMock.expect(service.getServiceInfo()).andReturn(si);
+        EasyMock.expect(epi.getService()).andReturn(si);
         InterfaceInfo ii = control.createMock(InterfaceInfo.class);
         EasyMock.expect(si.getInterface()).andReturn(ii);
         OperationInfo oi = control.createMock(OperationInfo.class);
@@ -157,10 +161,12 @@
             new Class[] {OperationInfo.class, Object[].class, Map.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
         proxy.setReliableEndpoint(rme);
-        Service service = control.createMock(Service.class);
-        EasyMock.expect(rme.getService()).andReturn(service);
+        Endpoint endpoint = control.createMock(Endpoint.class);
+        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint);
+        EndpointInfo epi = control.createMock(EndpointInfo.class);
+        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);
         ServiceInfo si = control.createMock(ServiceInfo.class);
-        EasyMock.expect(service.getServiceInfo()).andReturn(si);
+        EasyMock.expect(epi.getService()).andReturn(si);
         InterfaceInfo ii = control.createMock(InterfaceInfo.class);
         EasyMock.expect(si.getInterface()).andReturn(ii);
         OperationInfo oi = control.createMock(OperationInfo.class);
@@ -279,10 +285,12 @@
         Identifier offeredId = control.createMock(Identifier.class);
         EasyMock.expect(source.generateSequenceIdentifier()).andReturn(offeredId);
              
-        Service service = control.createMock(Service.class);
-        EasyMock.expect(rme.getService()).andReturn(service);
+        Endpoint endpoint = control.createMock(Endpoint.class);
+        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint);
+        EndpointInfo epi = control.createMock(EndpointInfo.class);
+        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);
         ServiceInfo si = control.createMock(ServiceInfo.class);
-        EasyMock.expect(service.getServiceInfo()).andReturn(si);
+        EasyMock.expect(epi.getService()).andReturn(si);
         InterfaceInfo ii = control.createMock(InterfaceInfo.class);
         EasyMock.expect(si.getInterface()).andReturn(ii);
         OperationInfo oi = control.createMock(OperationInfo.class);

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java Thu Apr 12 15:22:52 2007
@@ -263,7 +263,7 @@
        
     private void verifyService() {        
         Service service = rme.getService();
-        ServiceInfo si = service.getServiceInfo();
+        ServiceInfo si = service.getServiceInfos().get(0);
         assertNotNull("service info is null", si);
 
         InterfaceInfo intf = si.getInterface();

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java Thu Apr 12 15:22:52 2007
@@ -59,6 +59,7 @@
 import org.apache.hello_world_soap_http.NoSuchCodeLitFault;
 import org.apache.hello_world_soap_http.SOAPService;
 import org.apache.hello_world_soap_http.SOAPServiceDocLitBare;
+import org.apache.hello_world_soap_http.SOAPServiceMultiPortTypeTest;
 import org.apache.hello_world_soap_http.types.BareDocumentResponse;
 import org.apache.hello_world_soap_http.types.GreetMeLaterResponse;
 import org.junit.BeforeClass;
@@ -90,7 +91,7 @@
         assertNotNull("cannot find test resource", url);
         defaultConfigFileName = url.toString();
 
-        assertTrue("server did not launch correctly", launchServer(Server.class));
+        assertTrue("server did not launch correctly", launchServer(Server.class, true));
     }
 
     
@@ -729,7 +730,23 @@
             e.printStackTrace();
             fail("There is some excpetion happened ");
         }    
-        
+    }
+    
+    @Test
+    public void testMultiPorts() throws Exception {
+        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+        assertNotNull(wsdl);
+        QName sname = new QName("http://apache.org/hello_world_soap_http",
+                                "SOAPServiceMultiPortTypeTest");
+        SOAPServiceMultiPortTypeTest service = new SOAPServiceMultiPortTypeTest(wsdl, sname);
+        
+        BareDocumentResponse resp = service.getDocLitBarePort().testDocLitBare("CXF");
+        assertNotNull(resp);
+        assertEquals("CXF", resp.getCompany());
+        
+                                                                                
+        String result = service.getGreeterPort().greetMe("CXF");
+        assertEquals("Hello CXF", result);
     }
 
     

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java Thu Apr 12 15:22:52 2007
@@ -35,8 +35,20 @@
         if (url != null) {
             System.setProperty("cxf.config.file.url", url.toString());
         }
-        Object implementor = new GreeterImpl();
-        String address = "http://localhost:9000/SoapContext/SoapPort";
+        Object implementor;
+        String address;
+        
+        implementor = new GreeterImplMultiPort();
+        address = "http://localhost:9020/MultiPort/GreeterPort";
+        Endpoint.publish(address, implementor);
+
+        implementor = new DocLitBareGreeterMultiPort();
+        address = "http://localhost:9021/MultiPort/DocBarePort";
+        Endpoint.publish(address, implementor);
+        
+        
+        implementor = new GreeterImpl();
+        address = "http://localhost:9000/SoapContext/SoapPort";
         Endpoint.publish(address, implementor);
         implementor = new DocLitBareGreeterImpl();
         address = "http://localhost:7600/SoapContext/SoapPort";
@@ -46,6 +58,8 @@
         implementor = new GreeterImplBogus();
         address = "http://localhost:9015/SoapContext/SoapPort";
         Endpoint.publish(address, implementor);
+        
+
     }
 
     public static void main(String[] args) {
@@ -68,5 +82,23 @@
                 wsdlLocation = "testutils/hello_world.wsdl")
     public class GreeterImplBogus extends GreeterImpl {
     
-    }    
+    } 
+    
+    @WebService(serviceName = "SOAPServiceMultiPortTypeTest", 
+                portName = "GreeterPort", 
+                endpointInterface = "org.apache.hello_world_soap_http.Greeter",
+                targetNamespace = "http://apache.org/hello_world_soap_http",
+                wsdlLocation = "testutils/hello_world.wsdl") 
+    public class GreeterImplMultiPort extends GreeterImpl {
+    
+    } 
+    
+    @WebService(serviceName = "SOAPServiceMultiPortTypeTest", 
+            portName = "DocLitBarePort", 
+            endpointInterface = "org.apache.hello_world_soap_http.DocLitBare",
+            targetNamespace = "http://apache.org/hello_world_soap_http",
+            wsdlLocation = "testutils/hello_world.wsdl")
+    public class DocLitBareGreeterMultiPort extends DocLitBareGreeterImpl {
+    
+    }  
 }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java Thu Apr 12 15:22:52 2007
@@ -40,7 +40,6 @@
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -117,9 +116,7 @@
         serviceFactory.setServiceClass(serviceEndpointInterface);
         serviceFactory.setWsdlURL(ClientMtomXopTest.class.getResource("/wsdl/mtom_xop.wsdl"));
         Service service = serviceFactory.create();
-        ServiceInfo si = service.getServiceInfo();
-        EndpointInfo ei = null;
-        ei = si.getEndpoint(portName);
+        EndpointInfo ei = service.getEndpointInfo(portName);
         JaxWsEndpointImpl jaxwsEndpoint = new JaxWsEndpointImpl(bus, service, ei);
         SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding());
         jaxWsSoapBinding.setMTOMEnabled(true);

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java Thu Apr 12 15:22:52 2007
@@ -50,7 +50,7 @@
             serviceFactory.setBus(bus);
             Service service = serviceFactory.create();
             QName endpointName = implInfo.getEndpointName();
-            EndpointInfo ei = service.getServiceInfo().getEndpoint(endpointName);
+            EndpointInfo ei = service.getEndpointInfo(endpointName);
             service.setInvoker(new JAXWSMethodInvoker(implementor));
             org.apache.cxf.endpoint.EndpointImpl endpoint = new JaxWsEndpointImpl(bus, service, ei);
             SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding()); 

Modified: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl (original)
+++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl Thu Apr 12 15:22:52 2007
@@ -395,5 +395,13 @@
             <soap:address location="FOO"/>
         </wsdl:port>
     </wsdl:service>
+    <wsdl:service name="SOAPServiceMultiPortTypeTest">
+		<wsdl:port name="GreeterPort" binding="tns:Greeter_SOAPBinding">
+            <soap:address location="http://localhost:9020/MultiPort/GreeterPort"/>
+        </wsdl:port>
+        <wsdl:port name="DocLitBarePort" binding="tns:Doc_Lit_Bare_SOAPBinding">
+            <soap:address location="http://localhost:9021/MultiPort/DocBarePort"/>
+        </wsdl:port>        
+    </wsdl:service>
 </wsdl:definitions>
 

Modified: incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java?view=diff&rev=528260&r1=528259&r2=528260
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java (original)
+++ incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilder.java Thu Apr 12 15:22:52 2007
@@ -37,8 +37,7 @@
     public ServiceInfo build() {
         try {
             Endpoint ep = createEndpoint();
-            
-            return ep.getService().getServiceInfo();
+            return ep.getEndpointInfo().getService();
         } catch (EndpointException e) {
             throw new ServiceConstructionException(e);
         } catch (BusException e) {