You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Luís Miguel Silva <lm...@ispgaya.pt> on 2007/09/18 15:28:58 UTC

Make axis client use cache

Hello everybody,

Does anybody know how to force an axis client to use cache on its requests?

I used the WSDL2Java tool to generate the axis code but all the requests ask for
"NO-CACHE".

Thanks in advance,
+----------------------------------------
| Luís Miguel Ferreira da Silva
| Instituto Superior Politécnico Gaya
| Rua António Rodrigues da Rocha, 291/341
| Sto. Ovídio • 4400-025 V. N. de Gaia
| Tel: +351 223745730/3/5
| GSM: +351 912671471
+----------------------------------------

----------------------------------------------------------------
Este email foi enviado via o webmail do ISPGaya
Instituto Superior Politécnico Gaya

Throwing an exception from handleResponse() in a JAX-RPC handler class

Posted by "Walker, Jeff" <Je...@fmr.com>.
Ok,
I have a strange problem.
I am writing a response handler on the serverside. The class extends javax.xml.rpc.handler.GenericHandler, so I am using JAX-RPC handlers, not Axis-based handlers. Now, in my handleResponse() I am hand-crafting a response using various calls to objects like:
...
Try {
  MessageID messageID = (MessageID)context.getProperty("messageID");
  SOAPMessageContext smContext = (SOAPMessageContext)context;
  SOAPMessage soapMessage = smContext.getMessage();
  SOAPHeader soapHeader = soapMessage.getSOAPHeader();
  Name blockName = SOAPFactory.newInstance().createName(MESSAGE_ID, "mi", HEADER_NS);
  SOAPHeaderElement headerBlock = soapHeader.addHeaderElement(blockName);
  headerBlock.setActor(HEADER_NS + "/message");
  headerBlock.addChildElement("messageId", "mi").addTextNode(messageID.getMessageId());
  headerBlock.addChildElement("To", "mi").addTextNode(messageID.getTo());
  headerBlock.addChildElement("From", "mi").addTextNode(messageID.getFrom());
  headerBlock.addChildElement("status", "mi").addTextNode(messageID.getStatus());
} catch (SOAPException se) {
  // ..and what do we do in here?? Just log it?
  // We aren't allowed to throw a SOAPFaultException!
}

...
Well, quite a few of these method calls can throw the ubiquitous SOAPException, so I wrapped it in a try-catch block. Great, but I believe that catch block should throw a javax.xml.rpc.soap.SOAPFaultException. But guess what, serverside response handlers are never supposed to throw exceptions!  Where did I get that hard-to-believe statement from?? From the last two sentences on page 414 of "J2EE Web Services" by Richard Monson-Haefel.

So, we have a situation where your supposed to catch some SOAPException but aren't allowed to send the exception to the client. Wierd!
Any thoughts?
Thanks,
-jeff



-----Original Message-----
From: Luís Miguel Silva [mailto:lms@ispgaya.pt] 
Sent: Tuesday, September 18, 2007 9:29 AM
To: axis-user@ws.apache.org
Subject: Make axis client use cache
Importance: High

Hello everybody,

Does anybody know how to force an axis client to use cache on its requests?

I used the WSDL2Java tool to generate the axis code but all the requests ask for
"NO-CACHE".

Thanks in advance,
+----------------------------------------
| Luís Miguel Ferreira da Silva
| Instituto Superior Politécnico Gaya
| Rua António Rodrigues da Rocha, 291/341
| Sto. Ovídio * 4400-025 V. N. de Gaia
| Tel: +351 223745730/3/5
| GSM: +351 912671471
+----------------------------------------

----------------------------------------------------------------
Este email foi enviado via o webmail do ISPGaya
Instituto Superior Politécnico Gaya



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org