IntelliJ Java IDE
The moose likes Web Services and the fly likes Problems with Web Services Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Problems with Web Services" Watch "Problems with Web Services" New topic
Author

Problems with Web Services

antonio rodriguez ayuso
Greenhorn

Joined: Apr 23, 2004
Posts: 14
Hello to all.

I have created an application in java, that it build a file PDF. This works correctly.

Now, my objective is that this application works in a web service.
When I compile the web service, I don't obtain compilation errors.
I don't have problems to deploy the SERVICE. But when I execute the client, I have exceptions:

run-cliet:
[java] Endpoint address = http://localhost:8080/preinscripcion/preinscripcion
[java] java.rmi.ServerException: JAXRPC.JAXRPCSERVLET.28: Missing port information
[java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:372)
[java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:224)
[java] at client_preinscripcion.ServicioIF_Stub.preinscribir(ServicioIF_Stub.java:68)
[java] at client_preinscripcion.cliente.main(Unknown Source)

run:

BUILD SUCCESSFUL

The code is:

import java.io.FileOutputStream;
import java.io.IOException;

import com.lowagie.text.*;
import com.lowagie.text.pdf.PdfWriter;

public class generatePDF
{
public void buildPDF(String Convocatoria)
{
String Message;

Document document = new Document();
try
{
PdfWriter.getInstance(document, new FileOutputStream("c:/generatePDF.pdf"));
document.open();
document.add(new Paragraph("Hello World"));
}
catch(DocumentException de) { Message="Error"; }
catch(IOException ioe) { Message="Error"; }

}//Fin de buildPDF

}

I use iText for convert to PDF.

I hope somebody can help me


Thank to all.
Christine Spietz
Greenhorn

Joined: Oct 29, 2004
Posts: 5
hi,

the interisting point would be the client-code an the location of your wsdl-file on the server.
In your client you should define a service like this:

Service service = serviceFactory.createService(new QName(uri, serviceName));

i guess, you have set a wrong value for uri, which should be a String which "shows" the path to aour wsdl-file on the server

z.b. String uri = "http://yourserver:8080/axis/services/yourservice?wsdl";

hope it helps

tine
antonio rodriguez ayuso
Greenhorn

Joined: Apr 23, 2004
Posts: 14
Hi Christine,

the uri of the wsdl is good.I explain to you:

My web service has two parts. In the first part, the web service save the data in one database. In the second part, the web service make one .pdf file with the data.

When run client, I have the exceptions, but the data are saved in the database.

The source code of the client is:

package cliente_preinscripcion;

import javax.xml.rpc.Stub;

public class cliente {

private String endpointAddress;

public static void main(String[] args) {

System.out.println("Endpoint address = " + args[0]);
try {
Stub stub = createProxy();
stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, args[0]);
ServicioIF preinscripcion = (ServicioIF)stub;
preinscripcion.preinscribir("76256","Rodriguez","Ayuso","Antonio","Jose Menendez Pidal","2","2A","Merida","Badajoz","06800","M",
"6841159","antonio.rgz@ya.com","SI"," "," "," ","No"," ","Universidad de Extremadura","Cient�fico-Tecnolog�as",
" "," ","P.A.U.","ITT TELEMATICA","INGENIERIA TELECOMUNICACIONES","ITT EQUIPOS ELECTR�NICOS"," "," "," "," ");
} catch (Exception ex) {
ex.printStackTrace();
}
}

private static Stub createProxy() {

return (Stub)(new PreinscripcionService_Impl().getServicioIFPort());
}
}

The function preinscribir (service), call to the functions than save the data in database and make the pdf file.

thank you, and I'm sorry, my english is very bad.
[ November 18, 2004: Message edited by: antonio rodriguez ayuso ]
 
IntelliJ Java IDE
 
subject: Problems with Web Services
 
Threads others viewed
JWSDP+JNI. Is it workable?
java.rmi.ServerException: Internal Server Error (serialization error....)
HTTP transport error: java.net.MalformedURLException: no protocol: REPLACE_WITH_ACTUAL_URL
dii client returning custom types
Web Service in JBoss 4.2.2GA
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture