Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-21-2012, 12:47 AM   PM User | #1
chris77780124
New to the CF scene

 
Join Date: Jun 2012
Posts: 8
Thanks: 5
Thanked 0 Times in 0 Posts
chris77780124 is an unknown quantity at this point
I'm trying to make asynchronous request with JavaScript and Ajax to the server to pas

Let me know if anyone can help. I can provide more images and text to explain how my process is working and see if I have the right code it all works but just the bottom part of the code.

I'm trying to make asynchronous request with JavaScript and Ajax to the server to pass information from a phone call to a program called fiserv.

The simplest way to put it is I want to make this script verify information and then just make a note of the account number page in this system called fiserv with this code. I'm a veteran web designer but have not messed with Ajax code to much so I'm kind of stuck. I've got a book called. "JavaScript & jQuery the Missing Manual" for help but have not seem to figure out the one bit of code to make it complete the request.

I'm using my companies' software to write the code and test it. It's called Lyricall Designer. Here is the main window and what it looks like.

Here is the code I can't seem to get to work. Just need it to cop the account number in to the notes section.

var accnt=dvxGetuserfield("UserDefined1");

alert (accnt);

var number=dvxGetuserfield("ANI");

alert (number);

var fiservdata=("True");

alert (fiservdata);

var region=("Dtest");

alert (region);

var API=("APIIVRPH");

alert (API);

var info=(API + "~" + accnt + "~" + number);

alert (info);

//var objXMLHttpRequest = CreateXMLHttpRequest();

//objXMLHttpRequest.open("GET","ws_slsapiws.specializedservicing.com/slsapiws/secure/api.asmx?",true);

//objXMLHttpRequest.setRequestHeader("Host"," ws_slsapiws.specializedservicing.com");

//objXMLHttpRequest.setRequestHeader("Content-Type"," text/xml; charset=utf-8");

//objXMLHttpRequest.setRequestHeader("SOAPAction",'"http://xxx.sls.net/SLSAPIws/API/execAPI"');

//var xmlhttp=new XMLHttpRequest();

var xmlhttp;

if (window.XMLHttpRequest)

{// code for IE7+, Firefox, Chrome, Opera, Safari

xmlhttp=new XMLHttpRequest();

var type=7;

}

else

{// code for IE6, IE5

xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

var type=6;

}

 

 

alert (type);



 

 

 

var packet =

'POST /slsapiws/secure/api.asmx HTTP/1.1' +

'\nHost: ws_slsapiws.specializedservicing.com' +

'\nContent-Type: text/xml; charset=utf-8' +

'\nContent_Length: 424 ' +

'\nSOAPAction: "http://www.sls.net/SLSAPIws/API/execAPIWithRegion"' +

'\n' +

'\n' +

'\n ';

'xmlns:xsd="http://www.w3.org/2001/XMLSchema"' + " " +

'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +

'\n' +' +

'\n' +

'\n' + info + '' +

'\nDtest' +

'\nfalse' +

'\n' +

'\n

'\n

alert (packet);

//objXMLHttpRequest.onreadystatechange = function (){

// if (objXMLHttpRequest.readyState == 4 && objXMLHttpRequest.state == 200){

// result = objXMLHttpRequest.responceXML;

// }

//}

//function CreateXMLHttpRequest() {

// if (typeof XMLHttpRequest != "undefined"){

// return new XMLHttpRequest();

// }

//else if (typeof ActiveXObject != "undefined"){

//return new ActiveXObject("Microsoft.XMLHTTP");

// }

// else {

// throw new Error("XMLHttpRequest not supported");

// }

//}

//objXMLHttpRequest.send(packet);

 

 

//OLDvar url=("ws_IVRServiceStg.specializedservicing.com/IVRService/IVR_FiservAPI.asmx?") + info;

 

var url=("http://ws_slsapiws.specializedservicing.com/slsapiws/secure/api.asmx?");

alert (url);

//xmlhttp.open("GET", url, true);

 

xmlhttp.open("GET","http://ws_slsapiws.specializedservicing.com/slsapiws/secure/api.asmx?",true);

xmlhttp.onreadystatechange = update;

xmlhttp.send(packet);

alert (xmlhttp.responceText);

//function update() {

// if (xmlhttp.readyState == 4)

// if (xmlhttp.status == 200)

//alert ("status 200")

//else if (xmlhttp.readyState == 0)

//alert ("readystate 0")

//else if (xmlhttp.readyState == 1)

//alert ("readystate 1")

//else if (xmlhttp.readyState == 2)

//alert ("readystate 2")

//else if (xmlhttp.readyState == 3)

//alert ("readystate 3")

//else alert ("Not 4");

//}

function update() {

alert ("readyState is " + xmlhttp.readyState + " Text '" + xmlhttp.status + "'");

}

location = 'Main.html';
chris77780124 is offline   Reply With Quote
Old 06-22-2012, 07:08 PM   PM User | #2
chris77780124
New to the CF scene

 
Join Date: Jun 2012
Posts: 8
Thanks: 5
Thanked 0 Times in 0 Posts
chris77780124 is an unknown quantity at this point
Can someone read my code to see if I just have one small thing wrong in my code.
chris77780124 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:25 PM.


Advertisement
Log in to turn off these ads.