So what I want to know is how you set up Spring to
accept a servlet/web service.
What is the aaa-servlet.xml file look like to
configure what bean? I see there is a bean for axis
setup, and what about a bean for xml-rpc setup?
What does the web.xml look like? I am really confused
on if I need a bean for every single web service I
wish to provide in Spring? Or just one bean and all
web service calls go to it? Do I have to set up the
web.xml to configure it as a servlet in order to get a
request to go to the web service?
These are things I am not seeming to find on the net.
Can anyone detail these a little more... the web.xml
setup (and why its needed if so) and the
aaa-servlet.xml file that spring uses, if needed and
why/how its done?
Thanks.
--- Dan O'Neill <[EMAIL PROTECTED]> wrote:
> I'm very sorry to everyone for that last email. I'm
> in a Web Services
> lecture at the moment and I didn't even look defore
> I emailed. I'm
> very sorry.
>
> Here is the real code
> ---------------------------------
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import javax.xml.rpc.ParameterMode;
>
> import java.sql.*;
> import java.util.Vector;
> //import java.util.Iterator;
> //import java.rmi.RemoteException;
> import org.apache.axis.client.Call;
> import org.apache.axis.client.Service;
> import org.apache.axis.encoding.XMLType;
> //import org.apache.axis.utils.Options;
> /*
> * Created on Jan 21, 2005
> *
> * TODO To change the template for this generated
> file go to
> * Window - Preferences - Java - Code Style - Code
> Templates
> */
>
> /**
> * @author Daniel
> *
> * TODO To change the template for this generated
> type comment go to
> * Window - Preferences - Java - Code Style - Code
> Templates
> */
> public class BookRoom extends HttpServlet{
>
> public void doPost(HttpServletRequest request,
> HttpServletResponse
> response) throws ServletException, IOException{
>
> Vector v = new Vector(20,5);
> String bandb_num =
> request.getParameter("bandb_no");
> int bandb_no = Integer.parseInt(bandb_num);
> String Roomnumber =
> request.getParameter("Roomnumber");
> String numpeeps =
> request.getParameter("numpeeps");
> String name = request.getParameter("name");
> String address = request.getParameter("address");
> String date = request.getParameter("date");
> String paid = "no";
>
> try{
> String endpoint = getService(bandb_no);
> String method ="bookRoom";
> Service service = new Service();
> Call call = (Call)
> service.createCall();
> call.setTargetEndpointAddress( new
> java.net.URL(endpoint) );
> call.setOperationName( method );
> call.addParameter( "op1", XMLType.SOAP_STRING,
> ParameterMode.IN );
> call.addParameter( "op2", XMLType.SOAP_STRING,
> ParameterMode.IN );
> call.addParameter( "op3", XMLType.SOAP_STRING,
> ParameterMode.IN );
> call.addParameter( "op4", XMLType.SOAP_STRING,
> ParameterMode.IN );
> call.addParameter( "op5", XMLType.SOAP_STRING,
> ParameterMode.IN );
> call.addParameter( "op6", XMLType.SOAP_STRING,
> ParameterMode.IN );
> call.setReturnType( XMLType.SOAP_BOOLEAN );
> call.invoke( new Object []
> {Roomnumber,date,name,address,numpeeps,paid});
> }catch (Exception e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> System.out.println("That did't work for some
> reason....");
> }
> PrintWriter output;
> response.setContentType("text/html");
> output = response.getWriter();
>
> output.println("<html><head><title>");
> output.println("hello"+bandb_num);
> output.println("</title><link
> href=\"../../hello.css\"
> rel=\"stylesheet\" type=\"text/css\"
> /></head><body>");
> output.println("<form
> action=\"http://localhost:8080/servlet/Local\"
> method=\"POST\">");
> output.println("<input type = \"hidden\"
> name=bandb_no
> value=\""+bandb_num+"\" />");
> output.println("<input type = \"hidden\"
> name=Roomnumber
> value=\""+Roomnumber+"\" />");
> output.println("<input type = \"hidden\" name=name
> value=\""+name+"\" />");
> output.println("<input type = \"hidden\" name=date
> value=\""+date+"\" />");
> output.println("<input type = \"hidden\"
> name=numpeeps
> value=\""+numpeeps+"\" />");
> output.println("<p align=center
> class=\"head\">Welcome to one Day
> Breaks in Killarny.com......</p>");
> output.println("Thank you for that "+name);
> output.println("Please choose whether to see other
> activites around
> killarny or not, below.");
> output.println("<input type=submit value
> =\"Submit\"/>");
> output.println("</form>");
> output.println("<form
> action=\"http://localhost:8080/servlet/SeeBooking1\"
> method=\"POST\">");
> output.println("<input type = \"hidden\"
> name=bandb_no
> value=\""+bandb_num+"\" />");
> output.println("<input type = \"hidden\"
> name=Roomnumber
> value=\""+Roomnumber+"\" />");
> output.println("<input type = \"hidden\" name=name
> value=\""+name+"\" />");
> output.println("<input type = \"hidden\" name=date
> value=\""+date+"\" />");
> output.println("<input type = \"hidden\"
> name=numpeeps
> value=\""+numpeeps+"\" />");
> output.println("<input type=submit value =\"See
> Booking\"/>");
> output.println("</form>");
> output.println("</body></html>");
>
>
> }
>
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/