Hi,
I create custom invoker and first I check cache if message exists then I
get message create doc and as in DOMOutHandler I set the prop. and set
serializer but xfire don't use DOMSerializer in debugging I see
WrappedBinding and because I return null as value I get empty soap
message.  I think I need to set something else but I could not figure
out what then I saw that PostInvokeHandler override serializer setting I
changed PostInvoker and I successfully got message. But is there better
way without changing PostInvokerHandler.
Thanks.. 
if(outMsg.getSerializer()==null)

outMsg.setSerializer(context.getBinding().getSerializer(context.getExcha
nge().getOperation()));

 
Thanks..
 
 
 
public Object invoke(Method arg0, Object[] arg1, MessageContext context)
throws XFireFault {
 
try {
    IWsinfoModel infoModel = new WsinfoModel();
    infoModel.setWsreferenceno(IDManager.getID());
    infoModel = msgService.readWSInfo(infoModel);
    if (infoModel != null && !"E".equals(infoModel.getType())) {
        if (infoModel.getOutmessage() != null) {
            OutMessage outMsg = context.getExchange().getOutMessage();
            DocumentBuilder builder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
            ByteArrayInputStream bis=new
ByteArrayInputStream(infoModel.getOutmessage().getBytes());
            Document doc=builder.parse(bis);
            outMsg.setProperty(DOMOutHandler.DOM_MESSAGE, doc);
            outMsg.setSerializer(new DOMSerializer());
            return null;
        }
    }
    infoModel = new WsinfoModel();
    infoModel.setWsreferenceno(IDManager.getID());
    Document doc = (Document) context.getCurrentMessage().getProperty(
    DOMInHandler.DOM_MESSAGE);
    if (doc != null) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DOMUtils.writeXml(doc.getDocumentElement(), bos);
        infoModel.setInmessage(new String(bos.toByteArray()));
    }
    msgService.createWSInfo(infoModel);
    return super.invoke(arg0, arg1, context);
} catch (Throwable t) {
        throw new XFireFault(t);
} finally {
}
 
}
 <outbind://35/890.gif> 
 

________________________________

From: Tomek Sztelak [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 17, 2007 10:17 AM
To: [email protected]
Subject: Re: [xfire-user] Handler Execution


You can't. Thats why in such cases you need to create custom service
invoker.


On 7/17/07, Lukas Zapletal < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote: 

        But how to stop the execution pipeline?
        
        LZ
        
        
        2007/7/16, Tomek Sztelak <[EMAIL PROTECTED]>: 
        

                Take a look at DOMOutHandler and probably you need to
create custom invoker. 
                
                
                
                On 7/16/07, Ozge Caglar < [EMAIL PROTECTED] > wrote: 

                        Hi,
                        How can I return response in my custom handler.
Can I stop execution of the current pipeline and without invoking
service I want to return a pre defined message?
                        Actually I want to log ws req and resp. when a
client makes a request with same id, I want to return the logged
response.
                        Thanks. 
                         
                         
                         
                         
                         
                          
                         
This message and attachments are confidential and intended solely for
the individual(s) stated in this
message. If you received this message although you are not the
addressee, you are responsible to keep the
message confidential. The sender has no responsibility for the accuracy
or correctness of the
information in the message and its attachments. Our company shall have
no liability for any changes
or late receiving, loss of integrity and confidentiality, viruses and
any damages caused in
anyway to your computer system.
        

Bu mesaj ve ekleri, mesajda gonderildigi belirtilen kisi/kisilere
ozeldir ve gizlidir. Bu mesajin muhatabi
olmamaniza ragmen tarafiniza ulasmis olmasi halinde mesaj iceriginin
gizliligi ve bu gizlilik yukumlulugune
uyulmasi zorunlulugu tarafiniz icin de soz konusudur. Mesaj ve eklerinde
yer alan bilgilerin dogrulugu ve
guncelligi konusunda gonderenin ya da sirketimizin herhangi bir
sorumlulugu bulunmamaktadir. Sirketimiz
mesajin ve bilgilerinin size degisiklige ugrayarak veya gec
ulasmasindan, butunlugunun ve gizliliginin
korunamamasindan, virus icermesinden ve bilgisayar sisteminize
verebilecegi herhangi bir zarardan
sorumlu tutulamaz.
        




                -- 
                -----
                When one of our products stops working, we'll blame
another vendor within 24 hours. 

        
        
        
        -- 
        Lukas Zapletal
        http://lukas.zapletalovi.com 




-- 
-----
When one of our products stops working, we'll blame another vendor
within 24 hours. 


This message and attachments are confidential and intended solely for the 
individual(s) stated in this
message. If you received this message although you are not the addressee, you 
are responsible to keep the
message confidential. The sender has no responsibility for the accuracy or 
correctness of the
information in the message and its attachments. Our company shall have no 
liability for any changes
or late receiving, loss of integrity and confidentiality, viruses and any 
damages caused in
anyway to your computer system.


Bu mesaj ve ekleri, mesajda gonderildigi belirtilen kisi/kisilere ozeldir ve 
gizlidir. Bu mesajin muhatabi
olmamaniza ragmen tarafiniza ulasmis olmasi halinde mesaj iceriginin gizliligi 
ve bu gizlilik yukumlulugune
uyulmasi zorunlulugu tarafiniz icin de soz konusudur. Mesaj ve eklerinde yer 
alan bilgilerin dogrulugu ve
guncelligi konusunda gonderenin ya da sirketimizin herhangi bir sorumlulugu 
bulunmamaktadir. Sirketimiz
mesajin ve bilgilerinin size degisiklige ugrayarak veya gec ulasmasindan, 
butunlugunun ve gizliliginin
korunamamasindan, virus icermesinden ve bilgisayar sisteminize verebilecegi 
herhangi bir zarardan
sorumlu tutulamaz.

<<890.gif>>

<<890.gif>>

Reply via email to