hello all,
I am a new bie to this axis..&web services
I did the following..
1.Wrote a simple java program(Hello msg).changed to .jws..deployed&i get back the result with the client too.
Hello.java
public class Hello
{
public String greet(String a_name)
{
return "Nice to meet you, "+a_name;
}
}
{
public String greet(String a_name)
{
return "Nice to meet you, "+a_name;
}
}
HelloClient.java
package samples.hello;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
import javax.xml.rpc.ParameterMode;
public class HelloClient
{
public static void main(String [] args)
throws Exception
{
Options options = new Options(args);
{
public static void main(String [] args)
throws Exception
{
Options options = new Options(args);
String endpoint = "http://172.16.1.156:8081" +
"/axis/Hello.jws";
"/axis/Hello.jws";
args = options.getRemainingArgs();
if (args == null || args.length != 1) {
System.err.println("Usage: Hello ");
return;
}
System.err.println("Usage: Hello ");
return;
}
Service service = new Service();
Call call = (Call) service.createCall();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("greet");
call.addParameter("name", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
call.setOperationName("greet");
call.addParameter("name", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
String msg = (String)call.invoke(new Object[] {args[0]});
System.out.println("Reply: " + msg);
}
}
------------------
}
}
------------------
Client execution is also not a problem,
But i read in internet that
This will return the XML format stuffs..is it soo.
When i check this..i just get the Hello.java source.Where i went wrong..
Am i doing any logical mistake
Thanks
Opensrc_eng
Yahoo! India Matrimony: Find your life partner online.