Information For Applications of Ws
Information For Applications of Ws
Information For Applications of Ws
10302589 Reply »
Hi guys
I am working with apache axis . I have successfully created web service in axis. They are
working fine when I am using the simple client. the code for client is below
package samples.userguide.project;
//import java.beans.Statement;
//import java.security.Provider.Service;
import java.sql.*;
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 java.util.Vector;
import javax.xml.rpc.ParameterMode;
//import org.omg.CORBA.ParameterMode;
//import sun.net.dns.ResolverConfiguration.Options;
}
}
but now I want to implement this client in a servlet. I tried the same code with servlet but it is not
working . the code which I used for the Servlet is below:
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.ws.WebServiceRef;
import java.sql.*;
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 java.util.Vector;
import javax.xml.rpc.ParameterMode;
//@WebServiceRef(wsdlLocation =
"http://localhost:8080/JaxWsTest/JaxWsServiceService?wsdl")
Service serv;
response.getWriter().println(ret);
}
catch(Exception e){
}
response.getWriter().close();
}
}
but it is not working what should i do ? and where should i put the jar files which was required to
run the simple client ? When i tried to call it it shows the following err
package com.iton;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.encoding.XMLType;
import javax.xml.rpc.holders.ObjectHolder;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import com.sun.corba.se.spi.oa.ObjectAdapterFactory;
/**
* Servlet implementation class for Servlet: Invoke
*
*/
public class Invoke extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet {
static final long serialVersionUID = 1L;
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public Invoke() {
super();
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest
request, HttpServletResponse response)
*/
protected void service(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
// TODO Auto-generated method stub
String endpointURL =
"http://localhost:8080/SamplewsCal/services/Calculations?wsdl";
Service serv = new Service();
try{
response.getWriter().println(ret);
}
catch(Exception e)
{
response.getWriter().close();
}
}