Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change 
notification.

The following page has been changed by AnnRobinson:
http://wiki.apache.org/ws/FrontPage/Axis2/MessageContextSaveRestore

------------------------------------------------------------------------------
  === Sample code to save a Message Context ===
  
    // attach a stream capable of writing objects to the output stream
+ 
-    ObjectOutputStream outObjStream = new ObjectOutputStream(outStream);
+   ObjectOutputStream outObjStream = new ObjectOutputStream(outStream);
                                                                      
    // save the message context
+ 
-    outObjStream.writeObject(msgContext);                               
+   outObjStream.writeObject(msgContext);                               
  
  
  === Sample code to restore a Message Context ===
  
    // attach a stream capable of reading objects from the input stream
+ 
-    ObjectInputStream inObjStream = new ObjectInputStream(inStream);       
+   ObjectInputStream inObjStream = new ObjectInputStream(inStream);       
                                                                           
    // restore the message context
+ 
-    MessageContext msgContext2 = (MessageContext) inObjStream.readObject();
+   MessageContext msgContext2 = (MessageContext) inObjStream.readObject();
                                                                           
-   // if you don't go through the axis engine then you need to 
+   // if you don't go through the axis engine then you need to
+ 
-    // activate the restored message context before using it
+   // activate the restored message context before using it
+ 
-     msgContext2.activate(configurationContext);                            
+   msgContext2.activate(configurationContext);                            
    
    
  == Limitations/Restrictions on the Message Context Serialization Support ==
@@ -145, +151 @@

  reading and writing the object.                                           
  
   private void writeObject ( ObjectOutputStream out ) throws IOException
+  
   -  use out.defaultWriteObject() for default serialization              
                                                                          
   private void readObject ( ObjectInputStream in ) throws IOException,   
   ClassNotFoundException
+  
   -  use in.defaultReadObject() for default de-serialization             
                                                                          
  The object can also explicitly declare the specific variables or fields to 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to