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 2009/07/08 03:59:29 UTC

svn commit: r792016 - in /cxf/branches/2.1.x-fixes: ./ rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/ systests/src/test/java/org/apache/cxf/systest/xmlbeans/

Author: dkulp
Date: Wed Jul  8 01:59:29 2009
New Revision: 792016

URL: http://svn.apache.org/viewvc?rev=792016&view=rev
Log:
Merged revisions 791952 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r791952 | dkulp | 2009-07-07 15:39:14 -0400 (Tue, 07 Jul 2009) | 9 lines
  
  Merged revisions 791753 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r791753 | ffang | 2009-07-07 04:49:02 -0400 (Tue, 07 Jul 2009) | 1 line
    
    [CXF-2322] can't publish endpoint with XmlBeans databinding when build servicemodel from class
  ........
................

Added:
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/xmlbeans/ServerNoWsdl.java
      - copied unchanged from r791952, cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/xmlbeans/ServerNoWsdl.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml
      - copied unchanged from r791952, cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml
Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/xmlbeans/ClientServerXmlBeansTest.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul  8 01:59:29 2009
@@ -1,2 +1,2 @@
-/cxf/branches/2.2.x-fixes:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497,781841,782733,782735-782736,783099,783407,784064,784197,785293,785296,785298-785299,785301,785656,786158,786587,786589,786591-786592,786640,787272,787276,787282-787283,787285,787295,787307,787324,7873
 67,788824-788825,788827-788828,788830,789423,789429,789707,789709-789710,789712,789721,789905,789908,789910,789912,790295,790646-790647,790651,790654-790655,790659,791948,791950
-/cxf/trunk:782181,782728-782730,783097,783396,784059,784181,784895,785279-785282,785468,786142,786271,786395,786582-786583,786638,786647,787269,787277-787279,787290,787305,787323,787366,788060,788187,788703,788774,788820,789371,789420,789527-789529,789704-789705,789896,789898-789900,790294,790637-790644,791354,791538
+/cxf/branches/2.2.x-fixes:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497,781841,782733,782735-782736,783099,783407,784064,784197,785293,785296,785298-785299,785301,785656,786158,786587,786589,786591-786592,786640,787272,787276,787282-787283,787285,787295,787307,787324,7873
 67,788824-788825,788827-788828,788830,789423,789429,789707,789709-789710,789712,789721,789905,789908,789910,789912,790295,790646-790647,790651,790654-790655,790659,791948,791950,791952
+/cxf/trunk:782181,782728-782730,783097,783396,784059,784181,784895,785279-785282,785468,786142,786271,786395,786582-786583,786638,786647,787269,787277-787279,787290,787305,787323,787366,788060,788187,788703,788774,788820,789371,789420,789527-789529,789704-789705,789896,789898-789900,790294,790637-790644,791354,791538,791753

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java?rev=792016&r1=792015&r2=792016&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java (original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java Wed Jul  8 01:59:29 2009
@@ -196,8 +196,11 @@
             
             SchemaTypeSystem sts = st.getTypeSystem();
             schemas.getXmlSchemaCollection().setSchemaResolver(new XMLSchemaResolver(sts));
-
-            XmlSchema schema = getSchema(sts, st.getSourceName());
+            String sourceName = st.getSourceName();
+            if (sourceName.endsWith("wsdl")) {
+                return;
+            }
+            XmlSchema schema = getSchema(sts, sourceName);
 
             if (st.isDocumentType()) {
                 XmlSchemaElement sct = schema.getElementByName(st.getDocumentElementName());

Modified: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/xmlbeans/ClientServerXmlBeansTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/xmlbeans/ClientServerXmlBeansTest.java?rev=792016&r1=792015&r2=792016&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/xmlbeans/ClientServerXmlBeansTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/xmlbeans/ClientServerXmlBeansTest.java Wed Jul  8 01:59:29 2009
@@ -23,11 +23,15 @@
 
 import javax.xml.namespace.QName;
 import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPBinding;
 
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.helloWorldSoapHttp.xmlbeans.types.FaultDetailDocument;
 import org.apache.helloWorldSoapHttp.xmlbeans.types.FaultDetailDocument.FaultDetail;
@@ -48,6 +52,7 @@
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", launchServer(Server.class, true));
+        assertTrue("server did not launch correctly", launchServer(ServerNoWsdl.class, true));
     }
     
     @Test
@@ -61,7 +66,51 @@
         SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
         Greeter port = ss.getSoapPort();
         String resp; 
+        ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
+        ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
+        resp = port.sayHi();
+        assertEquals("We should get the right response", resp, "Bonjour");        
+        
+        resp = port.greetMe("Willem");
+        assertEquals("We should get the right response", resp, "Hello Willem");
+        
+        try {
+            resp = port.greetMe("Invoking greetMe with invalid length string, expecting exception...");
+            fail("We expect exception here");
+        } catch (WebServiceException ex) {           
+            assertTrue("Get a wrong exception", 
+                       ex.getMessage().
+                       indexOf("string length (67) is greater than maxLength facet (30)") >= 0);
+        }
+        
+        port.greetMeOneWay(System.getProperty("user.name"));
+        
+        try {
+            port.pingMe();
+            fail("We expect exception here");
+        } catch (PingMeFault ex) {            
+            FaultDetailDocument detailDocument = ex.getFaultInfo();
+            FaultDetail detail = detailDocument.getFaultDetail();
+            assertEquals("Wrong faultDetail major", detail.getMajor(), 2);
+            assertEquals("Wrong faultDetail minor:", detail.getMinor(), 1);             
+        }          
+    }
+    
+    @Test
+    public void testCallFromClientNoWsdlServer() throws Exception {
+        SpringBusFactory factory = new SpringBusFactory();
+        Bus bus = factory.createBus("org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml");
+        BusFactory.setDefaultBus(bus);
+        URL wsdl = this.getClass().getResource("/wsdl_systest/xmlbeans/hello_world.wsdl");
+        assertNotNull("We should found the WSDL her. " , wsdl);      
         
+        SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
+        QName soapPort = new QName("http://apache.org/hello_world_soap_http/xmlbeans", "SoapPort");
+        ss.addPort(soapPort, SOAPBinding.SOAP11HTTP_BINDING, "http://localhost:9010/SoapContext/SoapPort");
+        Greeter port = ss.getPort(soapPort, Greeter.class);
+        String resp; 
+        ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
+        ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
         resp = port.sayHi();
         assertEquals("We should get the right response", resp, "Bonjour");