• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Problems with Web Services

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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","[email protected]","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 ]
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic