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 "Martín R." <mm...@gmail.com> on 2011/04/13 12:27:11 UTC

[newbie]call a setNumber(int i) method and recovery with getNumber (by using only of code generation tools).

This is my simple ws:

public class Test {

protected int timeout=34;



public void setTimeout(int timeout) {
    this.timeout = timeout;
}

public int getTimeout() {
     return timeout;
}
}

, and by using wsdl2java to generate the client code and creating a
TestMain.java:

stub.setTimeout(111111);
System.out.println("value: "+stub.getTimeout());

I get 34. I want to get 111111 without have to look into the internals of
Axis2 (Contexts...).

Thank you, list.

AW: [newbie]call a setNumber(int i) method and recovery with getNumber (by using only of code generation tools).

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Can you put a TCPMONITOR between Client and Server to see what gets exchanged? YES you can

 

Can you confirm that the 11111 is sent from client to server?  YES you can

 

This to know where to start seeking for the problem with a debugger.

 

Do you master to set a breakpoint at your simple server methods to see if and when they get called?

 

What is delivered into your simple methods when you call setTimeout(1111)?

What is returned from your simple methods when you call getTimeout()?

 

If you break at getTimeout(), and look for the local variables you will see that int timeout is back at 34

 

Then you will probably understand the following:

 

You think (and many folk does so) you are talking to a persistent object, a service object which makes it among time and space?, 

 

but unless you configured it to support long lasting sessions i.e. scope="soapsession"  é all.

 

You will invoke getTimeout() on a brand new yet initialized object which never had a run on setTimeout() before.

 

This is to say:

 

You call setTimeout(1111) and it does it, but on return to the client this object is deleted and garbage collected.

 

Netx time you call getTimeout() and you get the initial value of the object which is 34.

 

So your service is a method and work but the object has gone in between the calls to your  web service.

 

So you have to master a bit more.

 

Basically you need a way to make your object not go away once it is instantiated.

Second you need a way to address the same object over and over again; 

And you need a way which needs to work even when you have 20 different sessions from one PC running 

and hence need to talk to 20 different instances of your web service class, this instances are called object.

 

You need the ws-addressing module engaged at client and server

 

Then you need to set the scope="soapsession"

 

And you need to resend the servicegroupId by setting the proper option in the service client.

 

And you need to adjust axis2.xml for this service to something more than 30000 ms if you intend to have no session timeout in 30 seconds.

 

 

Axis2.xml 

 

<!-- 

This will give out the timout of the configuration contexts, in milliseconds

  --> 

  <parameter name="ConfigContextTimeoutInterval">28800000</parameter> 

 

And be confident, it works, as we had to master this all as well, 

and all our servers work that way. They are real statefull objects. 

And each is just an Anker to an out of  process server running behind it, 

which is reachable from the JAVA service object through an IPC. 

 

Josef

 

 

Von: Martín R. [mailto:mmrrgg77@gmail.com] 
Gesendet: Samstag, 16. April 2011 20:08
An: java-user@axis.apache.org
Betreff: Fwd: [newbie]call a setNumber(int i) method and recovery with getNumber (by using only of code generation tools).

 


any suggestion pls?

 

On Fri, Apr 15, 2011 at 10:54 AM, Martín R. <mm...@gmail.com> wrote:

I'll summarize and attach files. I use WinXP, and default configs of tomcat7, axis2-1.5.4, JDK 6. (and wsdl2java -p com.cliente -d adb -u -uw -uri http://127.0.0.1/SNMP/services/Prueba?wsdl)

 

2 cases:

-when I don't put any wsdl in META-INF : no problem.

-when I put a copy of http://127.0.0.1/SNMP/services/Prueba?wsdl in META-INF/Prueba.wsdl : session lost and fault with method that use ServiceContext too (see code attached).

 

 

Any suggestion? Thank you very much.

 

 

On Wed, Apr 13, 2011 at 6:39 PM, Stadelmann Josef <jo...@axa-winterthur.ch> wrote:

	Maybe you can tell us just a little bit about your surrounding components and systems from which you personally think they should make it for you?

	What is you Platform

	What is your AS

	What is your Web Service Engine used

	How did you configure it?

	What commands and tools did you use to create stub and skeleton?

	Just if in case this is not too much work for you.

	Josef J

	 

	Von: Martín R. [mailto:mmrrgg77@gmail.com] 
	Gesendet: Mittwoch, 13. April 2011 12:27
	An: java-user@axis.apache.org
	Betreff: [newbie]call a setNumber(int i) method and recovery with getNumber (by using only of code generation tools).

	 

	This is my simple ws:

	 

	public class Test {
	
	protected int timeout=34;
	
	
	
	public void setTimeout(int timeout) {
	    this.timeout = timeout;
	}
	
	public int getTimeout() {
	     return timeout;
	}

	}

	 

	, and by using wsdl2java to generate the client code and creating a TestMain.java:

	 

	stub.setTimeout(111111); 
	System.out.println("value: "+stub.getTimeout());

	 

	I get 34. I want to get 111111 without have to look into the internals of Axis2 (Contexts...).

	 

	Thank you, list.

 

 

 


Fwd: [newbie]call a setNumber(int i) method and recovery with getNumber (by using only of code generation tools).

Posted by "Martín R." <mm...@gmail.com>.
any suggestion pls?


On Fri, Apr 15, 2011 at 10:54 AM, Martín R. <mm...@gmail.com> wrote:

> I'll summarize and attach files. I use WinXP, and default configs of
> tomcat7, axis2-1.5.4, JDK 6. (and wsdl2java -p com.cliente -d adb -u -uw
> -uri http://127.0.0.1/SNMP/services/Prueba?wsdl)
>
> 2 cases:
> -when I don't put any wsdl in META-INF : no problem.
> -when I put a copy of http://127.0.0.1/SNMP/services/Prueba?wsdl in
> META-INF/Prueba.wsdl : session lost and fault with method that use
> ServiceContext too (see code attached).
>
>
> Any suggestion? Thank you very much.
>
>
> On Wed, Apr 13, 2011 at 6:39 PM, Stadelmann Josef <
> josef.stadelmann@axa-winterthur.ch> wrote:
>
>> Maybe you can tell us just a little bit about your surrounding components
>> and systems from which you personally think they should make it for you?
>>
>> What is you Platform
>>
>> What is your AS
>>
>> What is your Web Service Engine used
>>
>> How did you configure it?
>>
>> What commands and tools did you use to create stub and skeleton?
>>
>> Just if in case this is not too much work for you.
>>
>> Josef J
>>
>>
>>
>> *Von:* Martín R. [mailto:mmrrgg77@gmail.com]
>> *Gesendet:* Mittwoch, 13. April 2011 12:27
>> *An:* java-user@axis.apache.org
>> *Betreff:* [newbie]call a setNumber(int i) method and recovery with
>> getNumber (by using only of code generation tools).
>>
>>
>>
>> This is my simple ws:
>>
>>
>>
>> public class Test {
>>
>> protected int timeout=34;
>>
>>
>>
>> public void setTimeout(int timeout) {
>>     this.timeout = timeout;
>> }
>>
>> public int getTimeout() {
>>      return timeout;
>> }
>>
>> }
>>
>>
>>
>> , and by using wsdl2java to generate the client code and creating a
>> TestMain.java:
>>
>>
>>
>> stub.setTimeout(111111);
>> System.out.println("value: "+stub.getTimeout());
>>
>>
>>
>> I get 34. I want to get 111111 without have to look into the internals of
>> Axis2 (Contexts...).
>>
>>
>>
>> Thank you, list.
>>
>
>

Re: [newbie]call a setNumber(int i) method and recovery with getNumber (by using only of code generation tools).

Posted by "Martín R." <mm...@gmail.com>.
I'll summarize and attach files. I use WinXP, and default configs of
tomcat7, axis2-1.5.4, JDK 6. (and wsdl2java -p com.cliente -d adb -u -uw
-uri http://127.0.0.1/SNMP/services/Prueba?wsdl)

2 cases:
-when I don't put any wsdl in META-INF : no problem.
-when I put a copy of http://127.0.0.1/SNMP/services/Prueba?wsdl in
META-INF/Prueba.wsdl : session lost and fault with method that use
ServiceContext too (see code attached).


Any suggestion? Thank you very much.


On Wed, Apr 13, 2011 at 6:39 PM, Stadelmann Josef <
josef.stadelmann@axa-winterthur.ch> wrote:

> Maybe you can tell us just a little bit about your surrounding components
> and systems from which you personally think they should make it for you?
>
> What is you Platform
>
> What is your AS
>
> What is your Web Service Engine used
>
> How did you configure it?
>
> What commands and tools did you use to create stub and skeleton?
>
> Just if in case this is not too much work for you.
>
> Josef J
>
>
>
> *Von:* Martín R. [mailto:mmrrgg77@gmail.com]
> *Gesendet:* Mittwoch, 13. April 2011 12:27
> *An:* java-user@axis.apache.org
> *Betreff:* [newbie]call a setNumber(int i) method and recovery with
> getNumber (by using only of code generation tools).
>
>
>
> This is my simple ws:
>
>
>
> public class Test {
>
> protected int timeout=34;
>
>
>
> public void setTimeout(int timeout) {
>     this.timeout = timeout;
> }
>
> public int getTimeout() {
>      return timeout;
> }
>
> }
>
>
>
> , and by using wsdl2java to generate the client code and creating a
> TestMain.java:
>
>
>
> stub.setTimeout(111111);
> System.out.println("value: "+stub.getTimeout());
>
>
>
> I get 34. I want to get 111111 without have to look into the internals of
> Axis2 (Contexts...).
>
>
>
> Thank you, list.
>

AW: [newbie]call a setNumber(int i) method and recovery with getNumber (by using only of code generation tools).

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Maybe you can tell us just a little bit about your surrounding components and systems from which you personally think they should make it for you?

What is you Platform

What is your AS

What is your Web Service Engine used

How did you configure it?

What commands and tools did you use to create stub and skeleton?

Just if in case this is not too much work for you.

Josef J

 

Von: Martín R. [mailto:mmrrgg77@gmail.com] 
Gesendet: Mittwoch, 13. April 2011 12:27
An: java-user@axis.apache.org
Betreff: [newbie]call a setNumber(int i) method and recovery with getNumber (by using only of code generation tools).

 

This is my simple ws:

 

public class Test {

protected int timeout=34;



public void setTimeout(int timeout) {
    this.timeout = timeout;
}

public int getTimeout() {
     return timeout;
}

}

 

, and by using wsdl2java to generate the client code and creating a TestMain.java:

 

stub.setTimeout(111111); 
System.out.println("value: "+stub.getTimeout());

 

I get 34. I want to get 111111 without have to look into the internals of Axis2 (Contexts...).

 

Thank you, list.