You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Ramasamy S/O Valliappan <ra...@SIMTech.a-star.edu.sg> on 2004/10/13 05:28:07 UTC
Please Help Me !!!
Hi Guys
I have installed tomcat v5.0
and also added axis plugin successfully on to tomcat server.
I have a following deploy.wsdd file:
<deployment name="test" xmlns="http://xml.apache.org/axis/wsdd/">
<service name="BravoAirService">
<parameter name="OWLS_PATH" value="/axis/home/BravoAirService.owl" />
<transport name="http">
<parameter name="qs.owls" value="de.tuberlin.ivs.owl.QSOwlsHandler"/>
</transport>
</service>
</deployment>
This is my QSOwlsHandler.java file
package de.tuberlin.ivs.owl;
import org.apache.axis.transport.http.*;
import org.apache.axis.handlers.soap.*;
import org.apache.axis.*;
import javax.servlet.http.*;
import java.io.*;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import org.apache.axis.AxisFault;
import org.apache.axis.Constants;
import org.apache.axis.MessageContext;
import org.apache.axis.server.AxisServer;
import org.apache.axis.transport.http.HTTPConstants;
import org.apache.axis.utils.Messages;
import org.apache.axis.utils.XMLUtils;
import org.apache.commons.logging.Log;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class QSOwlsHandler implements QSHandler
{
public void invoke ( MessageContext msgContext ) throws AxisFault
{
// The wri t e r to wr i t e the r e spons e to the us e r
PrintWriter writer = (PrintWriter) msgContext.getProperty(HTTPConstants.PLUGIN_WRITER);
// The respons e obj e c t
HttpServletResponse response = (HttpServletResponse) msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE);
// The s e r v i c e obj e c t
SOAPService service = msgContext.getService( );
// Path to the DAML¡S s e r v i c e f i l e
String path = (String) service.getOption ("OWLS_PATH" );
try {
File owlsFile = new File(path) ;
FileInputStream in= new FileInputStream (owlsFile);
int c ;
while (( c=in.read()) != -1)
{
writer.write(c);
}
writer.flush();
}
catch ( FileNotFoundException fnfe)
{
// The DAMLS f i l e was not found , g ene r a t e HTTP 4 0 4 Er ror
response.setStatus (HttpURLConnection.HTTP_NOT_FOUND);
response.setContentType ("text/html");
}
catch ( IOException ioe )
{
// The DAMLS f i l e could not be opened , g ene r a t e HTTP I n t e r n a l Er ror
response.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
response.setContentType("text/html " );
}
}
}
Where to place my BravoAirService.owl file in the tomcat server ?
How to access the file from browser ?
This page displays the following output
http://localhost:8080/axis/servlet/AxisServlet
* AdminService (wsdl) <http://localhost:8080/axis/services/AdminService?wsdl>
* AdminService
* Version (wsdl) <http://localhost:8080/axis/services/Version?wsdl>
* getVersion
* BravoAirService (wsdl) <http://localhost:8080/axis/services/BravoAirService?wsdl>
But When I access the following url
http://localhost:8080/axis/services/BravoAirService?owls
I get the following error message
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Please try the following:
* If you typed the page address in the Address bar, make sure that it is spelled correctly.
* Open the localhost:8080 <http://localhost:8080> home page, and then look for links to the information you want.
* Click the <javascript:history.back(1)> <<ole0.bmp>> Back <javascript:history.back(1)> button to try another link.
* Click <javascript:doSearch()> <<ole1.bmp>> Search <javascript:doSearch()> to look for information on the Internet.
HTTP 400 - Bad Request
Internet Explorer
Please help me ASAP.
From
V. RAM
Singapore.