Hi All,
I am new to axis. I have deployed a sample axis web service which accepts a
sting and displays "Hello "+string.
I have created a applet client in that I am calling that web service. here I am
facing the following error.
java.net.MalformedURLException: no protocol: Axis
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at TestApplet.makeSoapCall(TestApplet.java:35)
at TestApplet.init(TestApplet.java:22)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Please help me to solve this issue. Then It would be a great help for me..
Here is my applet code:
import java.applet.*;
import org.apache.axis.AxisFault;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.rpc.ParameterMode;
import org.apache.axis.encoding.XMLType;
public class TestApplet1 extends Applet
{
private static String endpoint =
"http://xx.xx.xx.xx:8200/axis/services/TomcatTestService";
public void init () {
System.out.println("\n**********\nStarting up!\n");
makeSoapCall("Axis");
System.out.println("\n**********\n");
}
private static void makeSoapCall( String message ){
try {
// EndPoint URL for the HelloWorld Web Service
String endpointURL =message;
String methodName = "getHelloMessage";
Service service = new Service();
Call call = (Call) service.createCall();
//Set the endPoint URL
call.setTargetEndpointAddress (new java.net.URL(endpointURL));
call.setOperationName (methodName);
call.addParameter("name",XMLType.XSD_STRING,ParameterMode.IN);
call.setReturnType (XMLType.XSD_STRING);
String result = (String) call.invoke (new Object[] { "AXIS" } );
//Print out the result
System.out.println (result);
}catch (AxisFault fault) {
System.err.println("Error : " + fault.toString());
}
catch (Exception e) {
e.printStackTrace();
}
}
}
Regards,
Thamizhannal P
---------------------------------
From Chandigarh to Chennai - find friends all over India. Click here.