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 Ibrahim <is...@harf.com> on 2003/04/07 14:40:31 UTC
i ve a problem with setting variable
I develop this simple web Service(testSetGet.jws under /axis) as follows
:
public class testSetGet
{
String uname;
public String getUname()
{
return uname;
}
public void setUname(String newUname)
{
uname = newUname;
}
}
then I try to call her from the client hase this code :
// testSetGet
String endpoint = "http://isi:8080/axis/testSetGet.jws";
call.removeAllParameters();
call.setTargetEndpointAddress( new java.net.URL(endpoint)
);
call.setOperationName(new QName("http://soapinterop.org/",
"setUname"));
call.addParameter("newName",XMLType.XSD_STRING,ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
call.invoke( new Object[] { "Ahmed" } );
call.setOperationName(new QName("http://soapinterop.org/",
"getUname"));
//call.setReturnClass(String.Class);
call.setReturnType(XMLType.XSD_STRING);
call.removeAllParameters();
String ret1 = (String) call.invoke( new Object[] { "" } );
System.out.println("hiGreeting :Sent 'Hello!', got '" +
ret1 + "'");
First I get an runtime error :
No such operation 'getUname'
So please I want to know if the method getUname has no para,meter then
how can I invoke its result also if I use the setUname and call it from
getUname it return null !!!
Thanks for ur concerns
Best Regards
__^__ __^__
( ___ )---------------------------( ___ )
| / | IBRAHIM SAYED IBRAHIM | \ |
(_____)---------------------------(_____)