//so if you setup a messageContext and then set property for each stored 
attribute

org.apache.axis2.context.MessageContext simpleMsg = new 
org.apache.axis2.context.MessageContext();

simpleMsg.setProperty("my", "my");
simpleMsg.setProperty("dog", "dog");
simpleMsg.setProperty("has", "has");
simpleMsg.setProperty("fleas", "fleas");

//xml file I/O
        java.io.File theFile;
        java.lang.String theFilename;
        try {
            theFile =new java.io.File("pathname/request.xml");
            theFilename = theFile.getName();
            log.debug(title + "request.xml = [" + theFilename + "]");
        }
        catch (Exception ex) 
        {
            log.debug(title + "error creating request.xml file = [" + 
ex.getMessage() + "]");
            theFile = null;
        }
        if (theFile != null) 
        {
            try 
            {
                // setup an output stream to a physical file
                java.io.FileOutputStream outStream = new 
java.io.FileOutputStream(theFile);

                // attach a stream capable of writing objects to the 
                // stream connected to the file
                java.io.ObjectOutputStream outObjStream = new 
java.io.ObjectOutputStream(outStream);

                // try to save the message context
                log.debug(title + "saving message 
context....."+simpleMsg.getMessageID());
                outObjStream.writeObject(simpleMsg);

                // close out the streams
                outObjStream.flush();
                outObjStream.close();
                outStream.flush();
                outStream.close();
           }
           catch (Exception ex) 
           {
                log.debug(title + "error saving message context = [" +
                        ex.getClass().getName() + " : " + ex.getMessage() + 
"]");
            }
         } //end if

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




Date: Wed, 12 Aug 2009 10:05:19 -0400
Subject: Re: Axis2 - session management
From: ramyakgr...@gmail.com
To: axis-user@ws.apache.org

Thanks for ur tip on the CDATA. I'll look into that and come back with any 
issues I may have.
The other question I have is regarding storing the request xml.
Where and how could that be done?
I read that OperationContext and SOAPSession can be used to achieve this. But I 
will need some help with the API.
 
 
 
Thanks,
wsnewbie


On Wed, Aug 12, 2009 at 3:32 AM, Andreas Veithen <andreas.veit...@gmail.com> 
wrote:

You need to take into account that Axis2 by default doesn't preserve
CDATA sections (and converts them to text nodes). You can use the

approach described in [1] to change this.

Andreas

[1] http://people.apache.org/~veithen/synapse/faq.html




On Wed, Aug 12, 2009 at 00:39, Ramya K Grama<ramyakgr...@gmail.com> wrote:
> Hello,
> I'm using Axis2/Java to create a web service wherein the request and

> response xmls are very much the same except for some additional data from
> the db that gets added on to the request as a response.
> Also, there is a lot of CDATA sections in the request that need to be sent

> back in the response as is without any modification.
>
> In designing this service, we've come up with the strategy of saving the
> incoming SOAP request.xml(in memory) somewhere so that it can be used to

> recreate the response + updated data from the db (stuffing in empty tags
> with data from db).
>
> Is this a good approach as far as Axis2 is concerned. If so what/how would
> be teh best place of storing the request.xml. Are there any multi-threading

> issues that i need to be concerned about. What would be a fool-proof and
> optimal approach of doing this in Axis2.
>
> From my initial research, I've found that OperationContext with SOAPSession

> scope can be used for this. Am I correct here?
>
> Also, since there are a lot of CDATA sections in the request and response
> xmls, is there anything special that needs to be done?
>
> Your feedback will be very helpful in designing my service further.

>
> Thanks,
> wsNewbie.


_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=PID23384::T:WLMTAGL:ON:WL:en-US:NF_BR_sync:082009

Reply via email to