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 siva kondapalli <kv...@yahoo.com> on 2004/01/21 12:07:55 UTC

Writing JSP Client for a deployed Web Service

Hi,
     I posted this question(not in detail) before in this forum.I have deployed amy own Web service and written an Client.java program and it worked fine,which including below
*********************************************
import org.apache.axis.AxisFault;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.utils.Options;
import org.apache.axis.encoding.XMLType;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import MyService.*;
public class MyServiceClient
 {
   public static void main(String[] args) throws Exception
    {
      Service service = new Service();
      Call call = (Call) service.createCall();
      String endpointURL="http://localhost:8080/axis/servlet/AxisServlet";
      
      try
        {
         call.setTargetEndpointAddress(new java.net.URL(endpointURL));
         call.setOperationName(new QName("MyService","msqinput"));
         call.addParameter("msq",XMLType.XSD_STRING,ParameterMode.IN);
         call.setReturnType(XMLType.XSD_STRING);
         
         String msqstr=new String("005;498 002 002;205 027;374 145;3");
            
         
         String result=(String) call.invoke(new Object[] {msqstr});
         
         System.out.println("RESULT: " + result);       
        }
        catch(AxisFault fault)
          {
              System.out.println(fault.toString());
          }
      }
  }   
***************************************************************
I have  rewritten the Same Client program using JSP and copied that to "$Tomcat_HOME/webapps/axis/"  directory and tried accessing it using
http://localhost:8080/axis/MyClient.jsp and couldnt see the Output(result).
 
Can anyone please tell me where to place my Client JSP program to invoke a web service under Tomcat.
 
Thanks in advance
Rao.,
 


---------------------------------
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes