如何使用ajax调用在服务总线上发布的Web服务?

时间:2016-11-14 18:59:05

标签: ajax soap soa jdeveloper osb

我正在使用Oracle服务总线,我目前在jdeveloper中使用SOA创建了服务,我已经在提供oracle的服务总线上发布了,现在我需要从我在phonegap中制作的移动应用程序中访问它们。有谁知道怎么做?我在ajax中使用了一个函数,但它不起作用:

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"): }, }); }

1 个答案:

答案 0 :(得分:0)

您的网址末尾有?wsdl。这意味着您需要 服务的规范,而不是将消息发送到服务。

删除它,你可能会有更多的运气。