have a java web service (JAX -WS) ...
@WebMethod(operationName = "TraerConsulta")
public String TraerConsulta() {
try {
cl_integrens icl_integrens = new cl_integrens();
String as_xmldat = "";
as_xmldat = icl_integrens.sp_QueryReturnXML("sa", "dactaZQL2008", "exec sp_sysbas_dd_tabdef ?, ?, ?", 10, "001", "101", "estreg");
return as_xmldat;
} catch (Exception ex) {
Logger.getLogger(ws1.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
and i'm trying consume with jquery
function WebMethodConsulta() {
var codigo =$("#txtCodigo").val();
var nombre =$("#txtNombre").val();
var q = '<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://ift.tt/sVJIaE" xmlns:SOAP-ENV="http://ift.tt/sVJIaE">'+
'<SOAP-ENV:Header></SOAP-ENV:Header>'+
'<S:Body><ns2:TraerConsulta xmlns:ns2="http://ws/"/></S:Body></S:Envelope>';
$.ajax({
url: 'http://ift.tt/1GBGArC',
data: q,
type: 'post',
contentType: 'text/xml; charset="utf-8"',
success: function(res) {
var responseWS = $(res);
var data2 = responseWS.find("Body").find("TraerConsultaResponse").find("return").text();
alert(data2.toString());
$('#spnresu').html(data2.toString());
},
error: ServiceFailed
});
}
and it works ... but I get to activate the cross domain
help me please!!
Aucun commentaire:
Enregistrer un commentaire