Dear All
I am able to create simple web services which takes simple datatypes as input and display a result. I have been trying to create a web service from EJB which takes a PDF file as input and store it in the server. I am using WSAD 5.1.1
I tried the following code
public String getPDF(File appFile) {
if (appFile == null) {
LOG.error("PDF File missing");
return ("Error : PDF File required");
}
String filename = "temp.pdf";
try{
DataHandler pdfHandler = new DataHandler (new ByteArrayDataSource(appFile, null));
File PDFDir = new File (SystemSetupClass.getProperty("app.pdf.path") + filename);
FileOutputStream fileOutput = null;
fileOutput = new FileOutputStream (PDFDir);
pdfHandler.writeTo (fileOutput);
}
catch (FileNotFoundException fnfe) {
LOG.error("Error opening PDF file");
return "Error opening PDF file:" + fnfe.toString ();
}
catch (IOException ioe)
{
LOG.error("Error writing PDF file");
return "Error writing PDF file:" + ioe.toString ();
}
return "Success"
}
--------
when I start the server I am getting the following error
[12/13/04 14:08:06:047 EST] 3c91c622 InternalExcep F com.ibm.ws.webservices.engine.InternalException WSWS3227E: Error: Exception:
[12/13/04 14:08:06:057 EST] 3c91c622 InternalExcep F com.ibm.ws.webservices.engine.InternalException TRAS0014I: The following exception was logged java.lang.Exception: WSWS3034E: Error: The OperationDesc for getPDF was not matched to a method of com.process.ejb.TestEJB. Debug:name: TestEJB
Help please.
regards
Siva
[ December 12, 2004: Message edited by: Good Boy ]
[ December 12, 2004: Message edited by: Siva B ]
I am able to create simple web services which takes simple datatypes as input and display a result. I have been trying to create a web service from EJB which takes a PDF file as input and store it in the server. I am using WSAD 5.1.1
I tried the following code
public String getPDF(File appFile) {
if (appFile == null) {
LOG.error("PDF File missing");
return ("Error : PDF File required");
}
String filename = "temp.pdf";
try{
DataHandler pdfHandler = new DataHandler (new ByteArrayDataSource(appFile, null));
File PDFDir = new File (SystemSetupClass.getProperty("app.pdf.path") + filename);
FileOutputStream fileOutput = null;
fileOutput = new FileOutputStream (PDFDir);
pdfHandler.writeTo (fileOutput);
}
catch (FileNotFoundException fnfe) {
LOG.error("Error opening PDF file");
return "Error opening PDF file:" + fnfe.toString ();
}
catch (IOException ioe)
{
LOG.error("Error writing PDF file");
return "Error writing PDF file:" + ioe.toString ();
}
return "Success"
}
--------
when I start the server I am getting the following error
[12/13/04 14:08:06:047 EST] 3c91c622 InternalExcep F com.ibm.ws.webservices.engine.InternalException WSWS3227E: Error: Exception:
[12/13/04 14:08:06:057 EST] 3c91c622 InternalExcep F com.ibm.ws.webservices.engine.InternalException TRAS0014I: The following exception was logged java.lang.Exception: WSWS3034E: Error: The OperationDesc for getPDF was not matched to a method of com.process.ejb.TestEJB. Debug:name: TestEJB
Help please.
regards
Siva
[ December 12, 2004: Message edited by: Good Boy ]
[ December 12, 2004: Message edited by: Siva B ]