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 Xinjun Chen <xj...@gmail.com> on 2007/11/19 13:38:46 UTC

[Axis2] Unable to set socket timeout

I am trying to configure the default socket timeout configuration from 30000
milliseconds to 60000 milliseconds for my Axis2 client, following the
documentation (http://ws.apache.org/axis2/1_2/http-transport.html).
However, this configuration doesn't take effect. My client still receives
AxisFault Read timed out error.

My client is using Axis2 1.2 from inside Weblogic server 8.1 SP5 using Java
1.4.2_08.
My web service is hosted in Axis2 1.2 in Tomcat 5.5.17 using Java 1.5.0_06.

I have also tried to use options.setProperties, but it doesn't work either.
Has anyone successfully modified the socket timeout value in Axis2?

Regards,
Xinjun

Re: [Axis2] Unable to set socket timeout

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
I think the problem is on the way you create your service client -  
you have to create it by passing as argument your custom axis2.xml.

Michele

On 20 Nov 2007, at 02:13, Xinjun Chen wrote:

> Hi Julio,
>
> Thanks for your reply.
>
> I have managed to set socket timeout. Till now, I have tried the  
> following.
>
> 1. Configure the following in axis2.xml TransportSender http and  
> https:
>         <parameter name="SO_TIMEOUT" locked="false">60000</parameter>
>         <parameter name="CONNECTION_TIMEOUT" locked="false">60000</ 
> parameter>
>
> Result: Failure. It doesn't take effect at all.
>
> 2. In client code, set options property.
>             options.setProperty(HTTPConstants.SO_TIMEOUT,new Integer 
> (so_timeout));
>             options.setProperty 
> (HTTPConstants.CONNECTION_TIMEOUT,new Integer(conn_timeout));
>
> Result: Failure. It doesn't take effect at all.
>
> 3. Configure the following in axis2.xml TransportReceiver http:
>              <parameter name="requestTimeout" locked="false">60000</ 
> parameter>
>
> Result: Failure. It doesn't take effect at all.
>
> 4. In client code, set options timeout
>             options.setTimeOutInMilliSeconds(timeout);
>
> Result: Success.
>
>
> Since the first three ways of set timeout is not working, why it  
> still exist in Axis2? Is this a bug or my environment issue?
>
>
> Regards,
> Xinjun
>
>
>
> On Nov 20, 2007 8:49 AM, juliocest <ju...@gmail.com> wrote:
>
> Dear Xinjun,
>
> First of all you have to import the packages below in the client code:
>
> import org.apache.axis2.client.Options;
> import org.apache.axis2.Constants;
>
> After,
>
> Options options = new Options();
>
> options.setProperty(HTTPConstans.SO_TIMEOUT, new Integer(360000);   
> (timeout
> of 5 minutes)
>
>
> Try to do it.
>
> Julio
> Sao Carlos - SP - Brazil
>
> --
> View this message in context: http://www.nabble.com/-Axis2--Unable- 
> to-set-socket-timeout-tf4836105.html#a13848812
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


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


Re: [Axis2] Unable to set socket timeout

Posted by Xinjun Chen <xj...@gmail.com>.
Hi Julio,

Thanks for your reply.

I have managed to set socket timeout. Till now, I have tried the following.

1. Configure the following in axis2.xml TransportSender http and https:
        <parameter name="SO_TIMEOUT" locked="false">60000</parameter>
        <parameter name="CONNECTION_TIMEOUT"
locked="false">60000</parameter>

Result: Failure. It doesn't take effect at all.

2. In client code, set options property.
            options.setProperty(HTTPConstants.SO_TIMEOUT,new
Integer(so_timeout));
            options.setProperty(HTTPConstants.CONNECTION_TIMEOUT,new
Integer(conn_timeout));

Result: Failure. It doesn't take effect at all.

3. Configure the following in axis2.xml TransportReceiver http:
             <parameter name="requestTimeout"
locked="false">60000</parameter>

Result: Failure. It doesn't take effect at all.

4. In client code, set options timeout
            options.setTimeOutInMilliSeconds(timeout);

Result: Success.


Since the first three ways of set timeout is not working, why it still exist
in Axis2? Is this a bug or my environment issue?


Regards,
Xinjun



On Nov 20, 2007 8:49 AM, juliocest <ju...@gmail.com> wrote:

>
> Dear Xinjun,
>
> First of all you have to import the packages below in the client code:
>
> import org.apache.axis2.client.Options;
> import org.apache.axis2.Constants;
>
> After,
>
> Options options = new Options();
>
> options.setProperty(HTTPConstans.SO_TIMEOUT, new Integer(360000);
>  (timeout
> of 5 minutes)
>
>
> Try to do it.
>
> Julio
> Sao Carlos - SP - Brazil
>
> --
> View this message in context:
> http://www.nabble.com/-Axis2--Unable-to-set-socket-timeout-tf4836105.html#a13848812
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

RE: Does Axis 2 allow passing of sub class objects ??

Posted by "Petr V." <gr...@yahoo.com>.
Hi Vivek,

Thanks for that. I used any ways java2wsdl from command line to generate java classes and I saw all the subclasses generated but when I called the web service, I got instantiation exception :-( . I will update you if I find any thing interesting

Thanks,

Petr

Vivekananda Moosani <vi...@persistent.co.in> wrote: Hi Petr,

The schema looks fine. You have an attribute "generateAllClasses" for the
ant task.
You can refer http://ws.apache.org/axis2/tools/1_3/CodegenToolReference.html
here for more options (both for command line execution and for the ant task)

Regards,
Vivek
________________________________________
From: Petr V. [mailto:greatman787@yahoo.com]
Sent: Wednesday, November 21, 2007 3:42 AM
To: axis-user@ws.apache.org
Subject: RE: Does Axis 2 allow passing of sub class objects ??

Thanks Moosani, I believe I am facing similar issue. Could you please help
me with following

I am seeing the snippet where I egenrate java classes from wsdl but not sure
how could I specify -g ?

 
wsdlFilename="http://localhost:8080/services/InventoryService?wsdl"
                  output="${build.dir}/client"
                  packageName="com.hp.cp.stubs.inv" databindingName="adb"
                         
namespaceToPackages="http://quickstart.samples/xsd=com.hp.cp.stubs.inv.xsd"
                 language="java"
                 synconly="true"

/>


and in wsdl, I added manually following snippet. Filter is an interface and
LocationFilter is a class implementing it


            
                
                    
                        
                            
type="xs:int"/>
                        
                    
                
            

Thanks in advance

Petr V.


Vivekananda Moosani  wrote:
Hello,
 
We had a similar case. We were generating both sever side and client classes
from WSDL. We had a DataNode type which gets passed in the WebService
methods. But the client can also send a subtype like StructuredDataNode or
UnstructuredDataNode. We had the subtypes even defined in the schema in the
WSDL.
 
If you have a similar situation then while generating classes also give –g
option to WSDL2Java. This generates classes for types which are not directly
used in Web service operations like the sub type in this case. You can pass
a subtype in the calls to Web Service methods.
 
Hope this helps!
 
-
Vivek
 
________________________________________
From: Petr V. [mailto:greatman787@yahoo.com]
Sent: Tuesday, November 20, 2007 6:31 AM
To: axis-user@ws.apache.org
Subject: Does Axis 2 allow passing of sub class objects ??
 
Let's assume that I have a web service that has an operation

void fun(MyInterface if)

can I call it like

fun(mo); where mo is of type MyObject that implements MyInterface.

Does Axis 2 and web services in general support this i-e passing object of
sub class or implementing class for interface.

Thanks,
 
________________________________________
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.
DISCLAIMER ========== This e-mail may contain privileged and confidential
information which is the property of Persistent Systems Ltd. It is intended
only for the use of the individual or entity to which it is addressed. If
you are not the intended recipient, you are not authorized to read, retain,
copy, print, distribute or use this message. If you have received this
communication in error, please notify the sender and delete all copies of
this message. Persistent Systems Ltd. does not accept any liability for
virus infected mails.


________________________________________
Never miss a thing. Make Yahoo your homepage.


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

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



       
---------------------------------
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now.

RE: Does Axis 2 allow passing of sub class objects ??

Posted by Vivekananda Moosani <vi...@persistent.co.in>.
Hi Petr, 

The schema looks fine. You have an attribute "generateAllClasses" for the
ant task. 
You can refer http://ws.apache.org/axis2/tools/1_3/CodegenToolReference.html
here for more options (both for command line execution and for the ant task)

Regards,
Vivek
________________________________________
From: Petr V. [mailto:greatman787@yahoo.com] 
Sent: Wednesday, November 21, 2007 3:42 AM
To: axis-user@ws.apache.org
Subject: RE: Does Axis 2 allow passing of sub class objects ??

Thanks Moosani, I believe I am facing similar issue. Could you please help
me with following

I am seeing the snippet where I egenrate java classes from wsdl but not sure
how could I specify -g ?

 <wsdl2java
wsdlFilename="http://localhost:8080/services/InventoryService?wsdl"
                  output="${build.dir}/client"
                  packageName="com.hp.cp.stubs.inv" databindingName="adb"
                         
namespaceToPackages="http://quickstart.samples/xsd=com.hp.cp.stubs.inv.xsd"
                 language="java" 
                 synconly="true" 

/>


and in wsdl, I added manually following snippet. Filter is an interface and
LocationFilter is a class implementing it

<xs:element name="LocationFilter" type="ns:LocationFilter" />
            <xs:complexType name="LocationFilter">
                <xs:complexContent>
                    <xs:extension base="ns:Filter">
                        <xs:sequence>
                            <xs:element name="locationId" nillable="true"
type="xs:int"/>
                        </xs:sequence>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>

Thanks in advance

Petr V.


Vivekananda Moosani <vi...@persistent.co.in> wrote:
Hello, 
 
We had a similar case. We were generating both sever side and client classes
from WSDL. We had a DataNode type which gets passed in the WebService
methods. But the client can also send a subtype like StructuredDataNode or
UnstructuredDataNode. We had the subtypes even defined in the schema in the
WSDL. 
 
If you have a similar situation then while generating classes also give –g
option to WSDL2Java. This generates classes for types which are not directly
used in Web service operations like the sub type in this case. You can pass
a subtype in the calls to Web Service methods. 
 
Hope this helps!
 
-
Vivek
 
________________________________________
From: Petr V. [mailto:greatman787@yahoo.com] 
Sent: Tuesday, November 20, 2007 6:31 AM
To: axis-user@ws.apache.org
Subject: Does Axis 2 allow passing of sub class objects ??
 
Let's assume that I have a web service that has an operation

void fun(MyInterface if) 

can I call it like 

fun(mo); where mo is of type MyObject that implements MyInterface.

Does Axis 2 and web services in general support this i-e passing object of
sub class or implementing class for interface.

Thanks,
  
________________________________________
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.
DISCLAIMER ========== This e-mail may contain privileged and confidential
information which is the property of Persistent Systems Ltd. It is intended
only for the use of the individual or entity to which it is addressed. If
you are not the intended recipient, you are not authorized to read, retain,
copy, print, distribute or use this message. If you have received this
communication in error, please notify the sender and delete all copies of
this message. Persistent Systems Ltd. does not accept any liability for
virus infected mails.

  
________________________________________
Never miss a thing. Make Yahoo your homepage. 


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

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


RE: Does Axis 2 allow passing of sub class objects ??

Posted by "Petr V." <gr...@yahoo.com>.
Thanks Moosani, I believe I am facing similar issue. Could you please help me with following

I am seeing the snippet where I egenrate java classes from wsdl but not sure how could I specify -g ?

 <wsdl2java wsdlFilename="http://localhost:8080/services/InventoryService?wsdl"
                  output="${build.dir}/client"
                  packageName="com.hp.cp.stubs.inv" databindingName="adb"
                          namespaceToPackages="http://quickstart.samples/xsd=com.hp.cp.stubs.inv.xsd"
                 language="java" 
                 synconly="true" 

/>


and in wsdl, I added manually following snippet. Filter is an interface and LocationFilter is a class implementing it

<xs:element name="LocationFilter" type="ns:LocationFilter" />
            <xs:complexType name="LocationFilter">
                <xs:complexContent>
                    <xs:extension base="ns:Filter">
                        <xs:sequence>
                            <xs:element name="locationId" nillable="true" type="xs:int"/>
                        </xs:sequence>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>

Thanks in advance

Petr V.


Vivekananda Moosani <vi...@persistent.co.in> wrote:        v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);}           Hello, 
   
  We had a similar case. We were generating both sever side and client classes from WSDL. We had a DataNode type which gets passed in the WebService methods. But the client can also send a subtype like StructuredDataNode or UnstructuredDataNode. We had the subtypes even defined in the schema in the WSDL. 
   
  If you have a similar situation then while generating classes also give –g option to WSDL2Java. This generates classes for types which are not directly used in Web service operations like the sub type in this case. You can pass a subtype in the calls to Web Service methods. 
   
  Hope this helps!
   
  -
  Vivek
   
      
---------------------------------
  
  From: Petr V. [mailto:greatman787@yahoo.com] 
 Sent: Tuesday, November 20, 2007 6:31 AM
 To: axis-user@ws.apache.org
 Subject: Does Axis 2 allow passing of sub class objects ??
  
   
  Let's assume that I have a web service that has an operation
 
 void fun(MyInterface if) 
 
 can I call it like 
 
 fun(mo); where mo is of type MyObject that implements MyInterface.
 
 Does Axis 2 and web services in general support this i-e passing object of sub class or implementing class for interface.
 
 Thanks,
    
    
---------------------------------
  
  Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.
  
  DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
 

       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.

RE: Does Axis 2 allow passing of sub class objects ??

Posted by Vivekananda Moosani <vi...@persistent.co.in>.
Hello, 

 

We had a similar case. We were generating both sever side and client classes
from WSDL. We had a DataNode type which gets passed in the WebService
methods. But the client can also send a subtype like StructuredDataNode or
UnstructuredDataNode. We had the subtypes even defined in the schema in the
WSDL. 

 

If you have a similar situation then while generating classes also give -g
option to WSDL2Java. This generates classes for types which are not directly
used in Web service operations like the sub type in this case. You can pass
a subtype in the calls to Web Service methods. 

 

Hope this helps!

 

-

Vivek

 

  _____  

From: Petr V. [mailto:greatman787@yahoo.com] 
Sent: Tuesday, November 20, 2007 6:31 AM
To: axis-user@ws.apache.org
Subject: Does Axis 2 allow passing of sub class objects ??

 

Let's assume that I have a web service that has an operation

void fun(MyInterface if) 

can I call it like 

fun(mo); where mo is of type MyObject that implements MyInterface.

Does Axis 2 and web services in general support this i-e passing object of
sub class or implementing class for interface.

Thanks,

  

  _____  

Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See
<http://us.rd.yahoo.com/evt=51732/*http:/overview.mail.yahoo.com/>  how.


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

Does Axis 2 allow passing of sub class objects ??

Posted by "Petr V." <gr...@yahoo.com>.
Let's assume that I have a web service that has an operation

void fun(MyInterface if) 

can I call it like 

fun(mo); where mo is of type MyObject that implements MyInterface.

Does Axis 2 and web services in general support this i-e passing object of sub class or implementing class for interface.

Thanks,

       
---------------------------------
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.

Re: [Axis2] Unable to set socket timeout

Posted by juliocest <ju...@gmail.com>.
Dear Xinjun,

First of all you have to import the packages below in the client code:

import org.apache.axis2.client.Options;
import org.apache.axis2.Constants;

After,

Options options = new Options();

options.setProperty(HTTPConstans.SO_TIMEOUT, new Integer(360000);  (timeout
of 5 minutes)


Try to do it.

Julio 
Sao Carlos - SP - Brazil

-- 
View this message in context: http://www.nabble.com/-Axis2--Unable-to-set-socket-timeout-tf4836105.html#a13848812
Sent from the Axis - User mailing list archive at Nabble.com.


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