Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

I am giving one ajax call to a Servlet which resides on other domain having different SSL. I am not able to redirect to the Servlet call instead getting 302 err

  • 2 ŋuɖoɖowo
  • 2 masɔmasɔ sia le wosi
  • 1 view
  • Nuɖoɖo mlɔetɔ cor-el

more options

I am giving one ajax call to a Servlet which resides on other domain having different SSL. I am not able to redirect to the Servlet call instead getting 302 error

Below is the firebug console trace:

POST https://seba-q.siemens-enterprise.com/portalstatistics/statisticAddEntry
	
302 Found
		911ms	
test.html (line 16)
HeadersPostResponseHTML
Response Headers
Connection	Keep-Alive
Content-Length	324
Content-Type	text/html; charset=iso-8859-1
Date	Fri, 05 Oct 2012 12:56:59 GMT
Keep-Alive	timeout=15, max=100
Location	http://www.siemens-enterprise.com:8888/seba/WrongServer.aspx
Server	Apache
Request Headers
Accept	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding	gzip, deflate
Accept-Language	en-us,en;q=0.5
Connection	keep-alive
Content-Length	158
Content-Type	application/x-www-form-urlencoded; charset=UTF-8
Host	seba-q.siemens-enterprise.com
Origin	https://integ-app-enterprise.siemens-enterprise.com
Referer	https://integ-app-enterprise.siemens-enterprise.com/webCenter/test.html
User-Agent	Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1
================

below is the code i am using

<html>
<head>
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<meta name="Access-Control-Allow-Origin" content="*">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>


<script>
var xmlhttpapp = new createXMLObj()

function sendStatisticTracker(fileurl, params) {
  xmlhttpapp.open('POST', fileurl, true);
  xmlhttpapp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlhttpapp.setRequestHeader("Content-length", params.length);
  xmlhttpapp.send(params);
};

function trackDownload(_portal, _download_source, _document_id, _document_name,_product_version,_product_id,_document_type,_document_language) {
  var fileurl = "https://seba-q.siemens-enterprise.com/portalstatistics/statisticAddEntry";
  var params = 

"portal="+_portal+"&downloadsource="+_download_source+"&documentid="+_document_id+"&documentname="+_document_name+"&productversion="+_product_version+"&productid="+_pr

oduct_id+"&documenttype="+_document_type+"&documentlanguage="+_document_language;
  sendStatisticTracker(fileurl, params);
}

function  trackPagehit(_portal,_portal_application, _portal_function) {
  var fileurl = "https://seba-q.siemens-enterprise.com/portalstatistics/statisticAddEntry";
  var params = "portal="+_portal+"&portalapplication="+_portal_application+"&portalfunction="+_portal_function;
  sendStatisticTracker(fileurl, params);
}

function trackSearch(_portal,_portal_application, _search_type, _search_string, _result_size) {
  var fileurl = "https://seba-q.siemens-enterprise.com/portalstatistics/statisticAddEntry";
  var params = "portal="+_portal+"&portalapplication="+_portal_application+"&searchtype="+_search_type+"&searchstring="+_search_string+"&resultsize="+_result_size;
  sendStatisticTracker(fileurl, params);
}

function createXMLObj()
{
  var xmlhttp1=false; //Clear our fetching variable
  try {
      xmlhttp1 = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object...
  } catch (e) {
    try {
      xmlhttp1 = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
    } catch (E) {
      xmlhttp1 = false;
    }
  }
  if (!xmlhttp1 && typeof xmlhttp1!='undefined') {
      xmlhttp1 = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
  }
  return  xmlhttp1;
}

</script>

 
</head>
<body>
    <h1><a href="https://integ-app-enterprise.siemens-enterprise.com/gdmsproxy/retrieve?id=30471967" target="_blank"
    onclick="trackDownload('cp', 'gdmsdownload', '101909', 'Document_Name' , '210090', '111999', 'doc', 'en');">Download</a></h1>
 
	<h1><a href="https://integ-app-enterprise.siemens-enterprise.com/gdmsproxy/retrieve?id=30471967" target="_blank"
    onclick="trackPagehit('cp', 'PortalSearch', 'productInformation');">Page Hit</a></h1>

    <h1><input type="submit" value="Search" onclick="trackSearch('cp', 'PortalSearch','SearchSoftware', 'Hipath 5000', '24');"/></h1>
 
</body>
</html>
I am giving one ajax call to a Servlet which resides on other domain having different SSL. I am not able to redirect to the Servlet call instead getting 302 error Below is the firebug console trace: <pre><nowiki>POST https://seba-q.siemens-enterprise.com/portalstatistics/statisticAddEntry 302 Found 911ms test.html (line 16) HeadersPostResponseHTML Response Headers Connection Keep-Alive Content-Length 324 Content-Type text/html; charset=iso-8859-1 Date Fri, 05 Oct 2012 12:56:59 GMT Keep-Alive timeout=15, max=100 Location http://www.siemens-enterprise.com:8888/seba/WrongServer.aspx Server Apache Request Headers Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding gzip, deflate Accept-Language en-us,en;q=0.5 Connection keep-alive Content-Length 158 Content-Type application/x-www-form-urlencoded; charset=UTF-8 Host seba-q.siemens-enterprise.com Origin https://integ-app-enterprise.siemens-enterprise.com Referer https://integ-app-enterprise.siemens-enterprise.com/webCenter/test.html User-Agent Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1 </nowiki></pre> ============================ below is the code i am using <pre><nowiki><html> <head> <meta http-equiv="Access-Control-Allow-Origin" content="*"> <meta name="Access-Control-Allow-Origin" content="*"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script> var xmlhttpapp = new createXMLObj() function sendStatisticTracker(fileurl, params) { xmlhttpapp.open('POST', fileurl, true); xmlhttpapp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttpapp.setRequestHeader("Content-length", params.length); xmlhttpapp.send(params); }; function trackDownload(_portal, _download_source, _document_id, _document_name,_product_version,_product_id,_document_type,_document_language) { var fileurl = "https://seba-q.siemens-enterprise.com/portalstatistics/statisticAddEntry"; var params = "portal="+_portal+"&downloadsource="+_download_source+"&documentid="+_document_id+"&documentname="+_document_name+"&productversion="+_product_version+"&productid="+_pr oduct_id+"&documenttype="+_document_type+"&documentlanguage="+_document_language; sendStatisticTracker(fileurl, params); } function trackPagehit(_portal,_portal_application, _portal_function) { var fileurl = "https://seba-q.siemens-enterprise.com/portalstatistics/statisticAddEntry"; var params = "portal="+_portal+"&portalapplication="+_portal_application+"&portalfunction="+_portal_function; sendStatisticTracker(fileurl, params); } function trackSearch(_portal,_portal_application, _search_type, _search_string, _result_size) { var fileurl = "https://seba-q.siemens-enterprise.com/portalstatistics/statisticAddEntry"; var params = "portal="+_portal+"&portalapplication="+_portal_application+"&searchtype="+_search_type+"&searchstring="+_search_string+"&resultsize="+_result_size; sendStatisticTracker(fileurl, params); } function createXMLObj() { var xmlhttp1=false; //Clear our fetching variable try { xmlhttp1 = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object... } catch (e) { try { xmlhttp1 = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object } catch (E) { xmlhttp1 = false; } } if (!xmlhttp1 && typeof xmlhttp1!='undefined') { xmlhttp1 = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest } return xmlhttp1; } </script> </head> <body> <h1><a href="https://integ-app-enterprise.siemens-enterprise.com/gdmsproxy/retrieve?id=30471967" target="_blank" onclick="trackDownload('cp', 'gdmsdownload', '101909', 'Document_Name' , '210090', '111999', 'doc', 'en');">Download</a></h1> <h1><a href="https://integ-app-enterprise.siemens-enterprise.com/gdmsproxy/retrieve?id=30471967" target="_blank" onclick="trackPagehit('cp', 'PortalSearch', 'productInformation');">Page Hit</a></h1> <h1><input type="submit" value="Search" onclick="trackSearch('cp', 'PortalSearch','SearchSoftware', 'Hipath 5000', '24');"/></h1> </body> </html></nowiki></pre>

cor-el trɔe

All Replies (2)

more options

(duplicate code removed by Moderator as it is already posted in the first post)

cor-el trɔe

more options

A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.

The helpers at that forum are more knowledgeable about web development issues.
You need to register at the MozillaZine forum site in order to post at that forum.