How to invoke a web service published on a service bus through AJAX? [closed]

3

I am working with Oracle Service Bus , I have currently created some services with SOA in JDeveloper , which I have published in bus service offered by Oracle , now I need to access them from my mobile application made in PhoneGap . Does anyone know how to do it? I used a function in AJAX but it does not work:

conectar = function () {
    var url = "http://10.0.0.191:7001/OSBCapled/Proxy_Services/AutenticacionWS?WSDL"
    var datos = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">'
        + '<soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
        + '</soap:Header>'
        + '<soapenv:Body>'
        + '<aut:requestRegistro xmlns:aut="http://www.integracion.org/autenticacion">'
        + '<aut:Email>'+$('#usuario').val()+'</aut:Email>'
        + '<aut:Clave>'+$('#clave').val()+'</aut:Clave>'
        + '</aut:requestRegistro>'
        + '</soapenv:Body>'
        + '</soapenv:Envelope>';
    $.ajax({
        url: url,
        type: "POST",
        crossDomain: true,
        async: false,
        data: datos,
        cache:false,
        dataType: 'text/xml',
        success: function (data) {
            alert("Funciono!! " + data.responseText);
        },
        error: function (data) {
           alert("Error"):
        },
    });
}
    
asked by maryvargas 11.11.2016 в 21:07
source

1 answer

0

I think you have the configuration of the ajax call wrong. You need to set the contentType that defines the type of data to send. If you verify the call through Soap UI, look at the headers in the request that are being sent.

Try adding this to your call

contentType: "text/xml; charset=\"utf-8\"",
    
answered by 15.11.2016 в 22:30