mavmanau
asked on
can anybody see anything wrong in this XML HTTP POST?
Hi,
Thank you for taking a look at my question. I have the basic html page with a little java in it, all I want to do it post some XML data to an API. Can anyone see where I am going wrong if anywhere?
This is the only error I can get to come up.
test.com : server does not support RFC 5746, see CVE-2009-3555
Your help is most appreciated!!
<html>
<head>
<script>
function connect(url,params)
{
var $cnct; // The variable that makes Ajax possible!
try{// Opera 8.0+, Firefox, Safari
alert ("Firefox selected");
$cnct = new XMLHttpRequest();}
catch (e){// Internet Explorer Browsers
try{
$cnct = new ActiveXObject("Msxml2.XMLH TTP");}
catch (e){
try{
$cnct = new ActiveXObject("Microsoft.X MLHTTP");}
catch (e){// Something went wrong
return false;}}}
$cnct.open("POST", "https://api.test.com/PRService.svc/Xml/generate",true);
$cnct.setRequestHeader("Co ntent-type ","text/xm l");
//$cnct.setRequestHeader($ cnct, "close");
$params = '<?xml version="1.0" encoding="utf-8"?><PDReque st xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><MCode>T101</ MCode><ACo de>TGJHFGD G#%</ACode ><RType>Em ail</RType ><PtAmount >300</Paym entAmount> <PReferenc e>123456</ PReference ><CEmail>Y es</CEmail ><CReferen ce>No</CRe ference><R Name>J Murphy</RecipientName><REm ail>sit@bi g.com</REm ail></PDRe quest>';
alert($params);
$cnct.send($params);
alert($cnct.responseText);
alert($cnct.responseBody);
alert($cnct.responseXML);
alert($cnct.getAllResponse Headers()) ;
//return(connection);
}
</script>
</head>
<body>
<FORM method="POST" name="ajax" action="">
<INPUT type="BUTTON" value="Submit" ONCLICK="connect('test','t est')">
<INPUT type="text" name="dyn" value="">
</FORM>
</body>
</html>
Thank you for taking a look at my question. I have the basic html page with a little java in it, all I want to do it post some XML data to an API. Can anyone see where I am going wrong if anywhere?
This is the only error I can get to come up.
test.com : server does not support RFC 5746, see CVE-2009-3555
Your help is most appreciated!!
<html>
<head>
<script>
function connect(url,params)
{
var $cnct; // The variable that makes Ajax possible!
try{// Opera 8.0+, Firefox, Safari
alert ("Firefox selected");
$cnct = new XMLHttpRequest();}
catch (e){// Internet Explorer Browsers
try{
$cnct = new ActiveXObject("Msxml2.XMLH
catch (e){
try{
$cnct = new ActiveXObject("Microsoft.X
catch (e){// Something went wrong
return false;}}}
$cnct.open("POST", "https://api.test.com/PRService.svc/Xml/generate",true);
$cnct.setRequestHeader("Co
//$cnct.setRequestHeader($
$params = '<?xml version="1.0" encoding="utf-8"?><PDReque
alert($params);
$cnct.send($params);
alert($cnct.responseText);
alert($cnct.responseBody);
alert($cnct.responseXML);
alert($cnct.getAllResponse
//return(connection);
}
</script>
</head>
<body>
<FORM method="POST" name="ajax" action="">
<INPUT type="BUTTON" value="Submit" ONCLICK="connect('test','t
<INPUT type="text" name="dyn" value="">
</FORM>
</body>
</html>
try with simple http rather than https
ASKER
it didn't work either...I haven't done anything wrong in the xmlhttprequest at all have I?
where do you get this error? which browser?
ASKER
firefox.
All I really want to do, is upload some XML - to a REST endpoint.
Can you see anything wrong in how I am going about the connection etc? from what I have seen it looks to be exactly how it should be in order to work.
All I really want to do, is upload some XML - to a REST endpoint.
Can you see anything wrong in how I am going about the connection etc? from what I have seen it looks to be exactly how it should be in order to work.
ASKER
I only see the error in the debug part of firefox. not sure if it is a warning or an error, from what I have seen on other sites from googling, the system should still try to get through anyway
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
awesome thank you, I shall have a play with it.
ASKER
Thank you for your help!! muchly appreciated.