axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jyotishman Pathak <jyotish...@gmail.com>
Subject Re: call web service from jsp
Date Thu, 03 Nov 2005 21:50:43 GMT
Personally, I am not familiar with JRun4. Is there some "lib" folder in the
container inside your application directory ?

Typically, Tomcat has a $CATALINA_HOME/your_application/WEB_INF/lib"
directory. I will try putting my stubs jar files in this directory and then
try running my app. Also, make sure there are no accessing/privilege
problems.

- Jyoti



On 11/3/05, Matthew Menefee <mmenefee@nationsholding.com> wrote:
>
>  I am working on a sample webservice and I have created a JSP for it.
>
>  The sample is from IBM and uses WebSphere, but I am using JRun4 and
> Eclipse. Here's a link to the sample:
>
>  http://www-128.ibm.com/developerworks/webservices/library/ws-castor/
>
>  My app is failing though, on this line:
>
>  StockQuotePortType port = service.getStockQuoteSOAPPort();
>
>  I'm getting a NoSuchMethodError when I run it.
>
>  Here's my JSP:
>
>  <%@ page session="true" contentType="text/html; charset=iso-8859-1"
> language="java" %>
>
> <%@ page import="com.ibm.w3.services.stockquote.*,
> javax.xml.rpc.ServiceException, java.rmi.RemoteException" %>
>
>  <%
>
> StockQuoteService service = *new *StockQuoteServiceLocator();
>
> Quote quote = *new *Quote();
>
> * try *{
>
> System.out.println("Got Here 1");
>
> String classPath = System.getProperty("java.class.path",".");
>
> System.out.println("classPath = " + classPath);
>
> StockQuotePortType port = service.getStockQuoteSOAPPort();
>
>  System.out.println("Got Here 2");
>
>  quote = port.getStockQuote("IBM");
>
> System.out.println("Got Here 3");
>
> }
>
> * catch *(ServiceException e) {
>
> System.out.println("ServiceException: " + e);
>
> }
>
> * catch *(RemoteException e) {
>
> System.out.println("RemoteException: " + e.getMessage());
>
> e.printStackTrace();
>
> }
>
> %>
>
>  <form>
>
> <table border ="0" cellpadding="0" cellspacing="10" width="100%">
>
> <tr><td>
>
> <table border="0" cellspacing="0" cellpadding="12" width="100%" bgcolor=
> "#000066">
>
> <tr><td>
>
> <table border="0" cellspacing="0" cellpadding="0">
>
> <tr><td>
>
> <font color="white" face="arial" size="10"><i>Stock Quote WS</i></font>
>
> </td></tr>
>
> <tr><td>
>
> <font color="white" face="arial" size="02"><i><b>
>
> Stock Quote: <%=quote.getVolume()%>
>
> </b></i></font>
>
> </td></tr>
>
> </table>
>
> </td></tr>
>
> </table>
>
> </td></tr>
>
> </table>
>
> </form>
>
>   ------------------------------
>
> *From:* Jyotishman Pathak [mailto:jyotishman@gmail.com]
> *Sent:* Thursday, November 03, 2005 2:58 PM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: call web service from jsp
>
>  My guess would be importing the required stubs in your JSP code, using
> the stub classes inside your JSP code, and setting the classpath
> appropriately.
>
> Another way could be to use Java beans+JSP combination for invoking the
> service. Off course, that depends on what kind of application you are
> building.
>
> HTH,
> - Jyoti
>
>  On 11/3/05, *Raffaele Viola* <raffovi@gmail.com> wrote:
>
> How can I call web service by a jsp page using the java classes created by
> Axis
>
> Thanks Raffo
>
>

Mime
View raw message