
31/05/2010, 16:37
|
| | Fecha de Ingreso: marzo-2010
Mensajes: 18
Antigüedad: 14 años, 10 meses Puntos: 3 | |
Respuesta: Cliente WebService / apache AXIS Hola, para evitarte tanto dolor de cabeza, instala el Eclipse y después el plugin de AXIS, en la página viene como se instala, es bastante sencillo, ahora para generar el cliente, deberás seleccionar la parte de AXIS y decirle de donde tomará la definición para el cliente, con unos cuantos Clicks tendrás tu cliente generado.
Saludos!!! Cita:
Iniciado por dackiller Hola a todos...
Tengo inconvenientes para consumir un WebService, actualmente estoy usando AXIS y no logro generar el XML que necesita el WebService...
Así deberia quedar el XML listo para ser enviado al WebService:
Código XML:
Ver original<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <soapenv:Body> <doPayment xmlns='Direccion del WebService/'> <paymentRequest xmlns=''> <arg1>10</arg1> <arg2>1</arg2> <arg3>true</arg3> <arg4>1111</arg4> </paymentRequest> </doPayment> </soapenv:Body> </soapenv:Envelope>
Así me esta quedando el XML generado por el Cliente AXIS
Código XML:
Ver original<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <doPayment soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> // AQUI DEBO GENERAR OTRO NODO llamado <paymentRequest> y no se como generarlo <arg1>10</arg1> <arg2>1</arg2> <arg3>true</arg3> <arg4>1111</arg4> // AQUI DEBERIA TERMINAR EL NODO </paymentRequest> </doPayment> </soapenv:Body> </soapenv:Envelope>
Código Java:
Ver originaltry { String endpoint = "http://127.0.0.1/"; // WebService Service serv = new Service(); Call req = (Call) serv.createCall(); req.setProperty(req.SEND_TYPE_ATTR,false); req. setTargetEndpointAddress(new java. net. URL(endpoint )); req.setOperationName("doPayment"); req.addParameter("arg1",XMLType.XSD_STRING, ParameterMode.IN); req.addParameter("arg2",XMLType.XSD_STRING, ParameterMode.IN); req.addParameter("arg3",XMLType.XSD_STRING, ParameterMode.IN); req.addParameter("arg4",XMLType.XSD_STRING, ParameterMode.IN); req.setReturnType(org.apache.axis.Constants.XSD_STRING); /* LLAMADA */ System. out. println("DEMONIOS ME ESTOY VOLVIENDO LOCO"); System. err. println(e. toString()); }
En AXIS realmente hay tanta info pero en ninguna he visto que dentro de una Operacion alla otro nodo y que contengan parametros, realmente no se si soy yo que tome una mala decision en usar AXIS ó los que desarrollaron el WebService no lo hicieron siguiendo los Estandares...
PD: Realmente desconozco el tema, si me pueden orientar les estaria agradecido, pero realmente lo que necesito es agregar el NODO <paymentRequest> y terminar con este proyecto que me tiene |@#~€|#~¬~€€¬
Gracias
Saludos... |