Foros del Web » Programación para mayores de 30 ;) » Java »

Netbeans, llamada a webservices y formulario

Estas en el tema de Netbeans, llamada a webservices y formulario en el foro de Java en Foros del Web. Hola, he desarrollado un web service con Netbeans 6.5.1. Como siempre, creo el proyecto, aplicación web y después el web service. Simplemente le paso una ...
  #1 (permalink)  
Antiguo 18/06/2009, 01:45
 
Fecha de Ingreso: septiembre-2003
Mensajes: 26
Antigüedad: 20 años, 8 meses
Puntos: 0
Netbeans, llamada a webservices y formulario

Hola, he desarrollado un web service con Netbeans 6.5.1. Como siempre, creo el proyecto, aplicación web y después el web service.

Simplemente le paso una variable String y devuelve la misma variable String para que se vea lo sencillo del problema.


Tengo el siguiente problema, intento llamar a la url del web service desde un formulario mediante los metodos GET y POST. El formulario con GET funciona correctamente mientras que con POST no funciona.

//Esto funciona correctamente
<FORM ACTION="ht tp://localhost:8080/proyecto/resources/actualizaport/operation/" enctype="TEXT/plain" METHOD="GET">;

<input type="text" name="textoXML">
<INPUT TYPE="submit" VALUE="Enviar consulta">
</FORM>


//Esto no funciona
<FORM ACTION="ht tp://localhost:8080/proyecto/resources/actualizaport/operation/" enctype="TEXT/plain" METHOD="POST">;


Este es el webmethod para el método GET:


@GET
@Path("textoxml/")
@Produces("text/plain")
@Consumes("text/plain")
@WebMethod(operationName = "textoXML")
public String textoXML(@WebParam(name = "textoXML")
String textoXML) {

System.out.println("texto variable XML : " + textoXML);
return textoXML
}

Este es el webmethod para el método POST:

@POST
@Path("textoxml/")
@Produces("text/plain")
@Consumes("text/plain")
@WebMethod(operationName = "textoXML")
public String textoXML(@WebParam(name = "textoXML")
String textoXML) {

System.out.println("texto variable XML : " + textoXML);
return textoXML
}




Bien, para el método GET, el formulario muestra el valor de textoXML,
sin embargo, para el método POST, el valor de texto XML es NULL.

Es algo tan sencillo como hacer un hola mundo llamando al método POST desde un formulario y no me funciona!!

Gracias de antebrazo!!
Saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:50.