cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r595187 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/common/xmlschema/ rt/javascript/src/main/java/org/apache/cxf/javascript/ rt/javascript/src/main/java/org/apache/cx...
Date Thu, 15 Nov 2007 02:24:47 GMT
Author: bimargulies
Date: Wed Nov 14 18:24:46 2007
New Revision: 595187

URL: http://svn.apache.org/viewvc?rev=595187&view=rev
Log:
Successfully serialize a doc/lit/wrapped message in Javascript and
accept it via the JAXB DataReader. Drop a bit of dead, commented-out
code from SchemaInfo.java.  Learn how to invoke the Rhino debugger 
from code that is embedding Rhino (wheeee).


Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
    incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/NamespacePrefixAccumulator.java
    incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
    incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
    incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/service/DocLitWrappedTest.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/types/SerializationTest.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java?rev=595187&r1=595186&r2=595187&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java Wed
Nov 14 18:24:46 2007
@@ -137,17 +137,6 @@
     }    
     
     public XmlSchemaElement getElementByQName(QName qname) {
-/*        String uri = qname.getNamespaceURI();
-        if (namespaceUri.equals(uri)) {
-            NodeList nodes = element.getElementsByTagName(qname.getLocalPart());
-            for (int i = 0; i < nodes.getLength(); i++) {
-                if (nodes.item(i) instanceof Element) {
-                    return (Element)nodes.item(i);
-                }
-
-            }
-        }
-        return null;*/
         String uri = qname.getNamespaceURI();
         if (schema != null 
             && schema.getTargetNamespace() != null

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java?rev=595187&r1=595186&r2=595187&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
Wed Nov 14 18:24:46 2007
@@ -37,6 +37,7 @@
 import org.apache.ws.commons.schema.XmlSchemaType;
 import org.apache.ws.commons.schema.extensions.ExtensionRegistry;
 import org.apache.ws.commons.schema.resolver.URIResolver;
+import org.apache.ws.commons.schema.utils.NamespaceMap;
 import org.apache.ws.commons.schema.utils.NamespacePrefixList;
 import org.apache.ws.commons.schema.utils.TargetNamespaceValidator;
 
@@ -55,6 +56,10 @@
     public SchemaCollection(XmlSchemaCollection col) {
         schemaCollection = col;
         col.getExtReg().setDefaultExtensionDeserializer(new FixedExtensionDeserializer());
+        if (schemaCollection.getNamespaceContext() == null) {
+        //      an empty prefix map avoids extra checks for null.
+            schemaCollection.setNamespaceContext(new NamespaceMap());
+        }
     }
 
     public boolean equals(Object obj) {
@@ -141,6 +146,20 @@
     public void setSchemaResolver(URIResolver schemaResolver) {
         schemaCollection.setSchemaResolver(schemaResolver);
     }
+    
+    /**
+     * This function is not part of the XmlSchema API. Who knows why?
+     * @param namespaceURI targetNamespace
+     * @return schema, or null.
+     */
+    public XmlSchema getSchemaByTargetNamespace(String namespaceURI) {
+        for (XmlSchema schema : schemaCollection.getXmlSchemas()) {
+            if (schema.getTargetNamespace().equals(namespaceURI)) {
+                return schema;
+            }
+        }
+        return null;
+    }
 
     /**
      * This is a really ugly trick to get around a bug or oversight in XmlSchema, which is
that
@@ -157,7 +176,7 @@
         StringReader reader = new StringReader(tinyXmlSchemaDocument.toString());
         return schemaCollection.read(reader, new ValidationEventHandler() { });
     }
-
+    
     /**
      * Validate that a qualified name points to some namespace in the schema.
      * @param qname

Modified: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/NamespacePrefixAccumulator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/NamespacePrefixAccumulator.java?rev=595187&r1=595186&r2=595187&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/NamespacePrefixAccumulator.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/NamespacePrefixAccumulator.java
Wed Nov 14 18:24:46 2007
@@ -24,6 +24,9 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.common.xmlschema.SchemaCollection;
 import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 
@@ -32,14 +35,14 @@
     private Set<String> prefixes;
     private Map<String, String> fallbackNamespacePrefixMap;
     private int nsCounter;
-    private SchemaInfo schemaInfo;
+    private SchemaCollection schemaCollection;
 
-    public NamespacePrefixAccumulator(SchemaInfo schemaInfo) {
+    public NamespacePrefixAccumulator(SchemaCollection schemaCollection) {
         attributes = new StringBuffer();
         prefixes = new HashSet<String>();
         fallbackNamespacePrefixMap = new HashMap<String, String>();
         nsCounter = 0;
-        this.schemaInfo = schemaInfo;
+        this.schemaCollection = schemaCollection;
     }
     
     public void collect(String prefix, String uri) {
@@ -54,7 +57,9 @@
     }
     
     private String getPrefix(String namespaceURI) {
-        String schemaPrefix = schemaInfo.getSchema().getNamespaceContext().getPrefix(namespaceURI);
+        String schemaPrefix = schemaCollection.getNamespaceContext().getPrefix(namespaceURI);
+        // there could also be a namespace context on an individual schema info.
+        // perhaps SchemaCollection should be enforcing some discipline there.
         if (schemaPrefix == null || "tns".equals(schemaPrefix)) {
             schemaPrefix = fallbackNamespacePrefixMap.get(namespaceURI);
             if (schemaPrefix == null) {
@@ -75,7 +80,7 @@
      * @param namespaceMap
      * @return
      */
-    public String xmlElementString(XmlSchemaElement element) {
+    public String xmlElementString(SchemaInfo schemaInfo, XmlSchemaElement element) {
         String namespaceURI = XmlSchemaUtils.getElementQualifier(schemaInfo, element);
         if ("".equals(namespaceURI)) {
             return element.getName(); // use the non-qualified name.
@@ -87,5 +92,10 @@
             return prefix + ":" + element.getName();
         }
     }
-
+    
+    public String xmlElementString(QName name) { // used with part concrete names
+        String prefix = getPrefix(name.getNamespaceURI());
+        collect(prefix, name.getNamespaceURI());
+        return prefix + ":" + name.getLocalPart();
+    }
 }

Modified: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java?rev=595187&r1=595186&r2=595187&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
Wed Nov 14 18:24:46 2007
@@ -68,13 +68,18 @@
     private SchemaCollection xmlSchemaCollection;
     private SchemaInfo serviceSchemaInfo;
     private XmlSchemaElement wrapperElement;
+    private NamespacePrefixAccumulator prefixAccumulator;
 
-    public ServiceJavascriptBuilder(ServiceInfo serviceInfo, NameManager nameManager) {
+
+    public ServiceJavascriptBuilder(ServiceInfo serviceInfo, 
+                                    NamespacePrefixAccumulator prefixAccumulator,
+                                    NameManager nameManager) {
         super(serviceInfo);
         code = new StringBuilder();
         utils = new JavascriptUtils(code);
         this.nameManager = nameManager;
         xmlSchemaCollection = serviceInfo.getXmlSchemaCollection();
+        this.prefixAccumulator = prefixAccumulator;
     }
 
     public String getCode() {
@@ -203,7 +208,6 @@
         String serializerFunctionName = nameManager.getJavascriptName(op.getName()) + "_serializeInput";
         
         code.append("function " + serializerFunctionName + "(args) {\n");
-        NamespacePrefixAccumulator prefixAccumulator = new NamespacePrefixAccumulator(serviceSchemaInfo);
         for (MessagePartInfo mpi : parts) {
             XmlSchemaElement element;
             if (mpi.isElement()) {
@@ -226,7 +230,7 @@
             assert element != null;
             assert element.getQName() != null;
             String partJavascriptVar = JavascriptUtils.javaScriptNameToken(element.getQName().getLocalPart());
-            String elementXmlRef = prefixAccumulator.xmlElementString(element);
+            String elementXmlRef = prefixAccumulator.xmlElementString(mpi.getConcreteName());
 
             elements.add(new ElementAndNames(element, partJavascriptVar, elementXmlRef));
         }

Modified: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java?rev=595187&r1=595186&r2=595187&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
Wed Nov 14 18:24:46 2007
@@ -54,13 +54,16 @@
     private SchemaCollection xmlSchemaCollection;
     private NameManager nameManager;
     private SchemaInfo schemaInfo;
+    private NamespacePrefixAccumulator prefixAccumulator;
     
     public SchemaJavascriptBuilder(SchemaCollection schemaCollection,
+                                   NamespacePrefixAccumulator prefixAccumulator,
                                    NameManager nameManager, 
                                    SchemaInfo schemaInfo) {
         this.xmlSchemaCollection = schemaCollection;
         this.nameManager = nameManager;
         this.schemaInfo = schemaInfo;
+        this.prefixAccumulator = prefixAccumulator;
     }
     
     public String generateCodeForSchema(SchemaInfo schema) {
@@ -174,8 +177,7 @@
         JavascriptUtils bodyUtils = new JavascriptUtils(bodyCode);
         bodyUtils.setXmlStringAccumulator("xml");
 
-        NamespacePrefixAccumulator prefixAccumulator = new NamespacePrefixAccumulator(schemaInfo);
-        complexTypeSerializerBody(type, "this._", bodyUtils, prefixAccumulator);
+        complexTypeSerializerBody(type, "this._", bodyUtils);
         
         StringBuilder code = new StringBuilder();
         JavascriptUtils utils = new JavascriptUtils(code);
@@ -218,8 +220,7 @@
      */
     protected void complexTypeSerializerBody(XmlSchemaComplexType type, 
                                           String elementPrefix, 
-                                          JavascriptUtils utils, 
-                                          NamespacePrefixAccumulator prefixAccumulator) {
+                                          JavascriptUtils utils) {
 
         XmlSchemaSequence sequence = XmlSchemaUtils.getSequence(type);
 
@@ -233,7 +234,7 @@
             // assume that no lunatic has created multiple elements that differ only by namespace.
             // or, perhaps, detect that when generating the parser?
             String elementName = elementPrefix + elChild.getName();
-            String elementXmlRef = prefixAccumulator.xmlElementString(elChild);
+            String elementXmlRef = prefixAccumulator.xmlElementString(schemaInfo, elChild);
             
             utils.generateCodeToSerializeElement("cxfjsutils", elChild, elementName, 
                                                  elementXmlRef, xmlSchemaCollection, null,
type);

Modified: incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js?rev=595187&r1=595186&r2=595187&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
(original)
+++ incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
Wed Nov 14 18:24:46 2007
@@ -164,7 +164,7 @@
 
 function org_apache_cxf_end_soap11_message()
 {
-	return '</soap-env:Body>';
+	return '</soap-env:Body></soap-env:Envelope>';
 }
 	
 CxfApacheOrgUtil.prototype.endSoap11Message = org_apache_cxf_end_soap11_message; 

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java?rev=595187&r1=595186&r2=595187&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
Wed Nov 14 18:24:46 2007
@@ -31,6 +31,7 @@
 import org.mozilla.javascript.Function;
 import org.mozilla.javascript.RhinoException;
 import org.mozilla.javascript.ScriptableObject;
+import org.mozilla.javascript.tools.debugger.Main;
 
 /**
  * Test utilities class with some Javascript capability included. 
@@ -85,6 +86,11 @@
     }
     
     public void initializeRhino() {
+        
+        if (System.getProperty("cxf.jsdebug") != null) {
+            Main.mainEmbedded("Debug embedded JavaScript.");
+        }
+
         rhinoContext = Context.enter();
         rhinoScope = rhinoContext.initStandardObjects();
         try {
@@ -117,6 +123,10 @@
 
     public Context getRhinoContext() {
         return rhinoContext;
+    }
+    
+    public Object javaToJS(Object value) {
+        return Context.javaToJS(value, rhinoScope);
     }
     
     public Object rhinoEvaluate(String jsExpression) {

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/service/DocLitWrappedTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/service/DocLitWrappedTest.java?rev=595187&r1=595186&r2=595187&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/service/DocLitWrappedTest.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/service/DocLitWrappedTest.java
Wed Nov 14 18:24:46 2007
@@ -37,6 +37,8 @@
 import org.apache.cxf.javascript.BasicNameManager;
 import org.apache.cxf.javascript.JavascriptTestUtilities;
 import org.apache.cxf.javascript.NameManager;
+import org.apache.cxf.javascript.NamespacePrefixAccumulator;
+import org.apache.cxf.javascript.fortest.BasicTypeFunctionReturnStringWrapper;
 import org.apache.cxf.javascript.types.SchemaJavascriptBuilder;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.service.model.MessageInfo;
@@ -47,7 +49,7 @@
 import org.junit.Test;
 import org.mozilla.javascript.Scriptable;
 
-@org.junit.Ignore
+//@org.junit.Ignore
 public class DocLitWrappedTest extends AbstractCXFSpringTest {
     private static final Logger LOG = LogUtils.getL7dLogger(DocLitWrappedTest.class);
     private static final String BASIC_TYPE_FUNCTION_RETURN_STRING_SERIALIZER_NAME 
@@ -60,6 +62,7 @@
     private NameManager nameManager;
     private JaxWsProxyFactoryBean clientProxyFactory;
     private XMLInputFactory xmlInputFactory;
+    private NamespacePrefixAccumulator prefixManager;
 
     public DocLitWrappedTest() {
         testUtilities = new JavascriptTestUtilities(getClass());
@@ -79,11 +82,11 @@
         assertNotNull(dataBinding);
         // the serialize function takes an array of the five parameters.
         Object[] params = new Object[5];
-        params[0] = new String("Hello<Dolly&sheep");
-        params[1] = new Integer(42);
-        params[2] = new Long(420000);
-        params[3] = new Float("3.14159");
-        params[4] = new Double("7.90834");
+        params[0] = testUtilities.javaToJS(new Float("3.14159"));
+        params[1] = testUtilities.javaToJS(new Double("7.90834"));
+        params[2] = testUtilities.javaToJS(new Integer(42));
+        params[3] = testUtilities.javaToJS(new Long(420000));
+        params[4] = testUtilities.javaToJS(new String("Hello<Dolly&sheep"));
         Scriptable jsParamArray = 
             testUtilities.getRhinoContext().newArray(testUtilities.getRhinoScope(), params);
         Object xmlString = null;
@@ -102,14 +105,20 @@
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(stringReader);
         boolean gotToPart = false;
         do {
-            xmlStreamReader.nextTag();
-            if (xmlStreamReader.getName().equals(part.getElementQName())) {
-                gotToPart = true;
+            int item = xmlStreamReader.next();
+            if (item == XMLStreamReader.START_ELEMENT) { 
+                LOG.finest(xmlStreamReader.getName().toString());
+                if (xmlStreamReader.getName().equals(part.getConcreteName())) {
+                    gotToPart = true;
+                }
             }
         } while (!gotToPart && xmlStreamReader.hasNext());
         assertTrue(gotToPart);
         Object messageObject = reader.read(part, xmlStreamReader);
         assertNotNull(messageObject);
+        assertTrue(messageObject instanceof BasicTypeFunctionReturnStringWrapper);
+        BasicTypeFunctionReturnStringWrapper wrapper = (BasicTypeFunctionReturnStringWrapper)messageObject;
+        assertEquals(params[4], wrapper.getS());
     }
 
     private void setupClientAndRhino(String clientProxyFactoryBeanId) throws IOException
{
@@ -126,22 +135,24 @@
         ServiceInfo serviceInfo = serviceInfos.get(0);
         schemata = serviceInfo.getSchemas();
         nameManager = new BasicNameManager(serviceInfo);
+        prefixManager = new NamespacePrefixAccumulator(serviceInfo.getXmlSchemaCollection());
         for (SchemaInfo schema : schemata) {
             SchemaJavascriptBuilder builder = 
-                new SchemaJavascriptBuilder(serviceInfo.getXmlSchemaCollection(), nameManager,
schema);
+                new SchemaJavascriptBuilder(serviceInfo.getXmlSchemaCollection(), 
+                                            prefixManager, nameManager, schema);
             String allThatJavascript = builder.generateCodeForSchema(schema);
             assertNotNull(allThatJavascript);
-            LOG.info(schema.toString());
-            LOG.info(allThatJavascript);
+            LOG.fine(schema.toString());
+            LOG.fine(allThatJavascript);
             testUtilities.readStringIntoRhino(allThatJavascript, schema.toString() + ".js");
         }
         
         ServiceJavascriptBuilder serviceBuilder = 
-            new ServiceJavascriptBuilder(serviceInfo, nameManager);
+            new ServiceJavascriptBuilder(serviceInfo, prefixManager, nameManager);
         serviceBuilder.walk();
         String serviceJavascript = serviceBuilder.getCode();
-        LOG.info(serviceInfo.toString());
-        LOG.info(serviceJavascript);
+        LOG.fine(serviceInfo.toString());
+        LOG.fine(serviceJavascript);
         testUtilities.readStringIntoRhino(serviceJavascript, serviceInfo.getName() + ".js");
     }
 }

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/types/SerializationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/types/SerializationTest.java?rev=595187&r1=595186&r2=595187&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/types/SerializationTest.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/types/SerializationTest.java
Wed Nov 14 18:24:46 2007
@@ -40,6 +40,7 @@
 import org.apache.cxf.javascript.BasicNameManager;
 import org.apache.cxf.javascript.JavascriptTestUtilities;
 import org.apache.cxf.javascript.NameManager;
+import org.apache.cxf.javascript.NamespacePrefixAccumulator;
 import org.apache.cxf.javascript.fortest.TestBean1;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.service.model.SchemaInfo;
@@ -193,9 +194,11 @@
         ServiceInfo serviceInfo = serviceInfos.get(0);
         schemata = serviceInfo.getSchemas();
         nameManager = new BasicNameManager(serviceInfo);
+        NamespacePrefixAccumulator prefixAccumulator = 
+            new NamespacePrefixAccumulator(serviceInfo.getXmlSchemaCollection());
         for (SchemaInfo schema : schemata) {
             SchemaJavascriptBuilder builder = new SchemaJavascriptBuilder(serviceInfo
-                .getXmlSchemaCollection(), nameManager, schema);
+                .getXmlSchemaCollection(), prefixAccumulator, nameManager, schema);
             String allThatJavascript = builder.generateCodeForSchema(schema);
             assertNotNull(allThatJavascript);
             testUtilities.readStringIntoRhino(allThatJavascript, schema.toString() + ".js");



Mime
View raw message