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 Sriram Nookala <sr...@m-qube.com> on 2004/04/12 22:11:54 UTC
SOAP client timeout
MessageHow can I increase the default timeout value of the Axis client?
thanks,
sriram
RE: SOAP client timeout
Posted by Sriram Nookala <sr...@m-qube.com>.
I came across the following thread which has a workaround for this. Is this
the only way to do when using SAAJ?
Can you please log this as a bug? we should find an easier way to do this.
Thanks,
dims
--- "Laenzlinger, Christof" <ch...@sunrise.net> wrote:
> Hallo Philip,
>
> I had the same problem a few weeks ago. With SAAJ only I could not find
> a way to configure the timeout. I did not find out how to modify the
default
> timeout in axis (still interested in a solution for that).
> Anyway that would not help if I want to modify the timeout individually
for
> each call.
>
> That is the solution I found:
>
> Instead of using the standard JAAS way of sending the message (snippet 1)
> I sent the message by using some Axis specific classes (snippet 2)
>
> --snippet
> 1------------------------------------------------------------------
>
> SOAPMessage message = // .... create your request message here
>
> SOAPConnectionFactory scFactory =
> SOAPConnectionFactory.newInstance();
> con = scFactory.createConnection();
>
> URLEndpoint endpoint = new URLEndpoint(getURLEndpoint());
> SOAPMessage responseMessage = con.call(message, endpoint);
>
> // consume the response message here...
> --------------------------------------------------------------------------
--
>
>
> --snippet
> 2------------------------------------------------------------------
> SOAPMessage message = // .... create your request message here
>
> Call call = new Call(getURLEndpoint());
> ((org.apache.axis.Message)
> message).setMessageContext(call.getMessageContext());
> SOAPEnvelope env =
> ((org.apache.axis.Message)message).getSOAPEnvelope();
> Attachments attachments = ((org.apache.axis.Message)
> message).getAttachmentsImpl();
> if (attachments != null) {
> Iterator iterator = attachments.getAttachments().iterator();
> while (iterator.hasNext()) {
> Object attachment = iterator.next();
> call.addAttachmentPart(attachment);
> }
> }
> call.setReturnClass(SOAPMessage.class);
> // set the timeout here
> call.setTimeout(new Integer(getTimeout()));
> call.invoke(env);
>
> SOAPMessage responseMessage = call.getResponseMessage();
>
> // consume the response message here...
> --------------------------------------------------------------------------
--
>
>
> -----Original Message-----
> From: Philip Puccio [mailto:philip.puccio@aexp.com]
> Sent: Thursday, July 10, 2003 7:03 PM
> To: axis-user@ws.apache.org
> Subject: Set timeout for SOAPMessage
>
>
> Hi,
>
> I've seen other threads asking about timeout and in the few cases where
> there
> are responses, the solution lies in using Call.setTimeout(int).
>
> I'm using SAAJ, so I'm dealing with a SOAPMessage. I see that
> MessageContext
> implements setTimeout, but when I try to get the MessageContext from the
> SOAPMessage (after casting down to Message so I can use
getMessageContext()
> ) ,
> I get null.
>
> I *think* I'm heading in the right direction here -- most of my service
> calls
> are very fast, so whatever the default timeout period is has been fine for
> me
> so far. But now I'm implementing a call that can take 60 to 90 seconds,
so
> I
> would like to change the timeout only for the SOAPMessage that contains
this
> longer-running service call.
>
> Thanks for any advice you can share on this,
>
> . . . Phil
>
>
>
> American Express made the following
> annotations on 07/10/2003 10:02:39 AM
> --------------------------------------------------------------------------
--
> --
>
****************************************************************************
> **
>
> "This message and any attachments are solely for the intended
recipient
> and may contain confidential or privileged information. If you are not the
> intended recipient, any disclosure, copying, use, or distribution of the
> information included in this message and any attachments is prohibited.
If
> you have received this communication in error, please notify us by reply
> e-mail and immediately and permanently delete this message and any
> attachments. Thank you."
>
>
****************************************************************************
> **
>
>
>
============================================================================
> ==
>
-----Original Message-----
From: Sriram Nookala [mailto:sriram@m-qube.com]
Sent: Monday, April 12, 2004 5:03 PM
To: axis-user@ws.apache.org
Subject: RE: SOAP client timeout
I use SAAJ for making the call, therefore don't use the call object.
I use
SOAPMessage response = conn.call(msg,
new URL(fVendorQPassURL));
where conn is a SOAPConnection.
Where can I set the timeout in this case?
-----Original Message-----
From: sreekantan, vijay [mailto:vijayakumars@yahoo.com]
Sent: Monday, April 12, 2004 4:16 PM
To: axis-user@ws.apache.org
Subject: Re: SOAP client timeout
Set it on the call object
_call.setTimeout();
Vijay
----------------------------------------------------------------------------
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
RE: SOAP client timeout
Posted by Sriram Nookala <sr...@m-qube.com>.
I use SAAJ for making the call, therefore don't use the call object.
I use
SOAPMessage response = conn.call(msg,
new URL(fVendorQPassURL));
where conn is a SOAPConnection.
Where can I set the timeout in this case?
-----Original Message-----
From: sreekantan, vijay [mailto:vijayakumars@yahoo.com]
Sent: Monday, April 12, 2004 4:16 PM
To: axis-user@ws.apache.org
Subject: Re: SOAP client timeout
Set it on the call object
_call.setTimeout();
Vijay
----------------------------------------------------------------------------
--
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
Re: SOAP client timeout
Posted by "sreekantan, vijay" <vi...@yahoo.com>.
Set it on the call object
_call.setTimeout();
Vijay
---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th