Let me rephrase my question .... is it possible to have the
following service class MyService so that I can first set the private instance
variable ( with setVar) and then immediately after on the next call ( with
getVar) retrieve it ? So far , I haven't been able to get it to work
...
public class MyService {
private String var;
public void setVar(String var) {
this.var = var;
}
public String getVar() {
return
var;
}
}
----- Original Message -----
Sent: Saturday, April 16, 2005 2:24
PM
Subject: service scope
I have a Service called Property ... what I am trying to do is to populate
this service object's instance variables and then retreive those instance
variables with get methods . I gave the service session scope ... The
following code is not giving me correct output . I always retreive null
instance variables ...
Is what I am trying to achieve possible and can the following code do it ?
If so , then the problem is elsewhere ... the populate method is using
database code to access mysql ...
String endpointURL = "http://localhost:8080/axis/services/Property";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new
java.net.URL(endpointURL) );
call.setOperationName( "setPropertyID");
Integer integer = new Integer(1);
call.invoke( new Object[] {integer});
call.setOperationName( "populate");
call.invoke( new Object[] {});
call.setOperationName("getPropertyID");
call.setReturnType( org.apache.axis.encoding.XMLType.XSD_INT );
Integer outPut1 = (Integer) call.invoke( new Object[] {});
out.println( "Property ID: " + outPut1.toString());
call.setOperationName( "getAddress");
call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING );
out.println( "Address: " + (String) call.invoke(new
Object[]
{}));
|