cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r586106 - in /incubator/cxf/trunk: rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ systests/src/test/java/org/apache/cxf/systest/provider/
Date Thu, 18 Oct 2007 19:55:08 GMT
Author: dkulp
Date: Thu Oct 18 12:55:07 2007
New Revision: 586106

URL: http://svn.apache.org/viewvc?rev=586106&view=rev
Log:
Throw fault if JAXB exception could not be mapped.   Call saveChanges before sending SAAJ
message

Modified:
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Messages.properties
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutDatabindingInterceptor.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/TestSOAPHandler.java

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?rev=586106&r1=586105&r2=586106&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Thu Oct 18 12:55:07 2007
@@ -21,12 +21,16 @@
 
 import java.lang.reflect.Field;
 import java.util.Iterator;
+import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
 
 import com.sun.xml.bind.v2.runtime.JAXBContextImpl;
 import com.sun.xml.bind.v2.runtime.JaxBeanInfo;
 
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.service.ServiceModelVisitor;
 import org.apache.cxf.service.model.FaultInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -46,6 +50,7 @@
  * Walks the service model and sets up the element/type names.
  */
 class JAXBSchemaInitializer extends ServiceModelVisitor {
+    private static final Logger LOG = LogUtils.getLogger(JAXBSchemaInitializer.class);
 
     private XmlSchemaCollection schemas;
     private JAXBContextImpl context;
@@ -196,6 +201,9 @@
             QName name = (QName)fault.getProperty("elementName");
             part.setElementQName(name);           
             JaxBeanInfo<?> beanInfo = context.getBeanInfo(cls);
+            if (beanInfo == null) {
+                throw new Fault(new Message("NO_BEAN_INFO", LOG, cls.getName()));
+            }
             SchemaInfo schemaInfo = null;
             for (SchemaInfo s : serviceInfo.getSchemas()) {
                 if (s.getNamespaceURI().equals(part.getElementQName().getNamespaceURI())

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Messages.properties?rev=586106&r1=586105&r2=586106&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Messages.properties
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Messages.properties
Thu Oct 18 12:55:07 2007
@@ -22,8 +22,10 @@
 SCHEMA_NOT_RESOLVED = Could not resolve URI: {0}
 UNKNOWN_SOURCE = Marshalling Error, unrecognized source {0}.
 MARSHAL_ERROR = Marshalling Error: {0}
-UNMARSHAL_ERROR = Unmarshalling Error : {0} 
+UNMARSHAL_ERROR = Unmarshalling Error: {0} 
 UNKNOWN_ELEMENT_NAME = Could not determine the element name for {0}.
 UNKNOWN_PACKAGE_NS = No package info found for class {0}. Cannot lookup default schema namespace.
 SCHEMA_GEN_EXC = Could not generate schemas.
 CREATED_JAXB_CONTEXT = Created JAXBContext "{0}" with classes {1}.
+NO_BEAN_INFO = Could not find JAXB information for bean class {0} in context.   Make sure
it follows JAXB conventions.
+ 
\ No newline at end of file

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutDatabindingInterceptor.java?rev=586106&r1=586105&r2=586106&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutDatabindingInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutDatabindingInterceptor.java
Thu Oct 18 12:55:07 2007
@@ -250,7 +250,7 @@
                         message.put(Message.PROTOCOL_HEADERS, heads);
                     }
                     
-                    //soapMessage.saveChanges();
+                    soapMessage.saveChanges();
                     Iterator<MimeHeader> smh = CastUtils.cast(soapMessage.getMimeHeaders().getAllHeaders());
                     while (smh.hasNext()) {
                         MimeHeader head = smh.next();

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java?rev=586106&r1=586105&r2=586106&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
Thu Oct 18 12:55:07 2007
@@ -22,7 +22,6 @@
 
 import javax.jws.HandlerChain;
 import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
 import javax.xml.soap.MessageFactory;
 import javax.xml.soap.SOAPBody;
 import javax.xml.soap.SOAPMessage;
@@ -76,15 +75,9 @@
                 response = sayHiResponse;
             } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
                 response = greetMeResponse;
-            } else if (n.getLocalName().equals("sayHiWAttach")) {
-                MessageFactory factory = MessageFactory.newInstance();            
-                InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
-                response = factory.createMessage(null, is);
-                is.close();
-                
-                AttachmentPart ap1 = response.createAttachmentPart();
-                ap1.setContent("Return Attachment content", "text/plain");
-                response.addAttachmentPart(ap1);
+            } else {
+                response = request;
+                //response.writeTo(System.out);
             }
         } catch (Exception ex) {
             ex.printStackTrace();

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java?rev=586106&r1=586105&r2=586106&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
Thu Oct 18 12:55:07 2007
@@ -55,13 +55,16 @@
         AttachmentPart ap1 = msg.createAttachmentPart();
         ap1.setContent("Attachment content", "text/plain");
         msg.addAttachmentPart(ap1);
+        AttachmentPart ap2 = msg.createAttachmentPart();
+        ap2.setContent("Attachment content - Part 2", "text/plain");
+        msg.addAttachmentPart(ap2);
         
         SOAPConnection con = conFac.createConnection();
         URL endpoint = new URL("http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit1");
         SOAPMessage response = con.call(msg, endpoint); 
         QName sayHiResp = new QName("http://apache.org/hello_world_rpclit", "sayHiResponse");
         assertNotNull(response.getSOAPBody().getChildElements(sayHiResp));
-        assertEquals(1, response.countAttachments());
+        assertEquals(2, response.countAttachments());
     }
 
     private void doGreeterRPCLit(SOAPServiceRPCLit service, QName portName, int count) throws
Exception {

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/TestSOAPHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/TestSOAPHandler.java?rev=586106&r1=586105&r2=586106&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/TestSOAPHandler.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/TestSOAPHandler.java
Thu Oct 18 12:55:07 2007
@@ -55,8 +55,9 @@
                         Object elem2 = it2.next();
                         if (elem2 instanceof SOAPElement) {
                             String value = ((SOAPElement)elem2).getValue();
-                            if (value.indexOf("Milestone-0") >= 0
-                                || value.indexOf("TestGreetMeResponseServerLogicalHandler")
>= 0) {
+                            if (value != null 
+                                && (value.indexOf("Milestone-0") >= 0
+                                || value.indexOf("TestGreetMeResponseServerLogicalHandler")
>= 0)) {
                                 value = value + "ServerSOAPHandler";
                                 ((SOAPElement)elem2).setValue(value);
                             }



Mime
View raw message