0

I am trying to do a jquery ajax SOAP request. But not able to make it work. The server I am trying to connect only receives request and response in SOAP format.

var productServiceUrl = 'https://edelivery2.readiness.metavante.com/ConnectwareWS/ePaymentServices';
var soapMessage = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://epayments.metavante.com/types/request" xmlns:com="http://metavante.com/types/common" xmlns:req1="http://epayments.metavante.com/types/security/request" xmlns:com1="http://epayments.metavante.com/types/common" xmlns:req2="http://epayments.metavante.com/types/consumer/request" xmlns:req3="http://epayments.metavante.com/types/user/request" xmlns:req4="http://epayments.metavante.com/types/fundingAccount/request" xmlns:req5="http://epayments.metavante.com/types/consumerPayee/request">'+
                '<soapenv:Header/>'+
                '<soapenv:Body>'+
                   '<req:EbMtvnSvcReq>'+
                      '<req:MtvnSvcVer>v1.0.0</req:MtvnSvcVer>'+
                      '<req:MsgUUID>9919cd11-346a-0323-0358-19fd184dba81</req:MsgUUID>'+
                      '<req:PrcsParms>'+
                         '<req:SrcID>DCUMOBILE</req:SrcID>'+
                      '</req:PrcsParms>'+
                      '<req:Svc>'+
                         '<req:SvcParms>'+
                            '<req:ApplID>EB_UAT</req:ApplID>'+
                            '<req:SvcID>GetConsumerPayeeDetails</req:SvcID>'+
                            '<req:SvcVer>v1.3.0</req:SvcVer>'+
                            '<req:RoutingID>hfs-3427</req:RoutingID>'+
                         '</req:SvcParms>'+
                         '<req:MsgData>'+
                            '<req:GetConsumerPayeeDetails>'+
                               '<com:locale>en-US</com:locale>'+
                               '<req1:userId>4811</req1:userId>'+
                            '</req:GetConsumerPayeeDetails>'+
                         '</req:MsgData>'+
                      '</req:Svc>'+
                   '</req:EbMtvnSvcReq>'+
                '</soapenv:Body>'+
                '</soapenv:Envelope>';

to do this request I am doing

$.ajax({
        url: productServiceUrl,
        type: "POST",
        dataType: "xml",
            processData: false,
        data: soapMessage,
        complete: endSaveProduct,
        contentType: "text/xml; charset=\"utf-8\"",
        success: processSuccess,
        error: processError

    });


function processSuccess(data, status, req) {
            if (status == "success")
                $("#response").text($(req.responseXML).find("HelloResult").text());
        }

        function processError(data, status, req) {
            console.log(data);
            console.log(status);
            console.log(req);
        }  

I am running the html page in my localhost. and doing the request as mentioned above. but getting error

![XMLHttpRequest cannot load https://edelivery2.readiness.metavante.com/ConnectwareWS/ePaymentServices. Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.][1]
Tushar Gupta - curioustushar
  • 54,013
  • 22
  • 95
  • 103
amrit_neo
  • 1,679
  • 4
  • 18
  • 38
  • 1
    this has nothing to do with SOAP, try this though http://stackoverflow.com/questions/298745/how-do-i-send-a-cross-domain-post-request-via-javascript/7605119#7605119 – povilasp Jan 11 '13 at 08:50
  • i think it only works for json datatypes. but mine is strict to SOAP – amrit_neo Jan 11 '13 at 10:42

0 Answers0