Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
The below coding works well in IE. I also need to work this code in safari.
 
function Transmit_SOAP()
{
if(window.ActiveXObject)
{//For IE Browsers. This coding works well in IE browsers
var tempNode=xmlSoapTemplate.selectSingleNode(pathString+"xmlDatasets");
tempNode.appendChild(xmlDataReturn.documentElement);
}
 
else
{//verify the code below.(Safari Support)
alert("Checking");
try{
var tempNode=xmlSoapTemplate.evaluate(pathString+"xmlDatasets", xmlSoapTemplate, null, XPathResult.ANY_TYPE,null);
}
catch (e)
{
alert(e);
}
tempNode.appendChild(xmlDataReturn.documentElement);
}
}
 
Kindly verify the safari code. The code execution breaks after showing the alert("Checking");
 
This is the error when using try catch
TypeError: Value undefined (result of expression xmlSoapTemplate.evaluate) is not object
 
The below code is xmlSoapTemplate
if(window.ActiveXObject)
{
//For IE Support.
//Begin by loading up the dataform via soap request
xmlSoapTemplate=new ActiveXObject("Microsoft.XMLDOM");
xmlSoapTemplate.onreadystatechange = function () {
if (xmlSoapTemplate.readyState == 4) Transmit_SOAP()
};
			
xmlSoapTemplate.load("../Dataforms/soap_1.xml");
}
 
// For Safari Support
 else
 {
 xmlSoapTemplate = new XMLHttpRequest();
 xmlSoapTemplate.open('GET','../Dataforms/soap_1.xml', true);
 xmlSoapTemplate.onreadystatechange = function() {
 if (xmlSoapTemplate.readyState == 4) {
  Transmit_SOAP()
   }
  }
  xmlSoapTemplate.send();
 }
Posted 21-Feb-13 1:58am
Mohan19841.3K
Edited 21-Feb-13 3:00am
v4
Comments
Ed Nutting at 21-Feb-13 7:30am
   
What were you trying to do? Can we see the complete code? (Since there are a lot of variables without any indication of what content they contain...) Any exception messages? Have you tried wrapping it in a try-catch(exception) block and reading the exception message? Have you used the built-in Safari debugger? Have you Google'd what are trying to do to see if anyone else has solved whatever issue(s) you are having?
 
There are too many unknowns for this question to be answerable. Please use the "Improve question" link above to update your question.
 
Thanks,
Ed
Mohan1984 at 21-Feb-13 7:59am
   
Improved my question. Kindly verify.
Ed Nutting at 21-Feb-13 8:12am
   
Much improved :) I now have at least some idea what your code is trying to do (and how :) ). Next step is to find out what it thinks is 'undefined'. Try opening the code in the Safari debugger and pause on the line that's giving you the error. Then check the values of all the inputs to the method (i.e. pathString, xmlSoapTemplate) - check to see if they are undefined. Also, search the web a bit and check that this is possible - you may need to convert the data that comes from the XMLHttpRequest into a proper XMLDocument (or XMLElement) which the request object is not. Essentially, I don't think the "evaluate" method exists on the XMLHttpRequest object. Search Google for how to convert XMLHttpRequest to XMLDocument then use the same code as you have but with the XMLDocument in place of xmlSoapTemplate for your parse code (not the request code - that can stay the same :) ).
 
Hope this helps,
Ed
Mohan1984 at 21-Feb-13 8:31am
   
alert(pathString+"xmlDatasets");
/// In Safari and IE it shows-->soap:Envelope/soap:Body/Update_DatasetsWiz/xmlDatasets

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

void compatibility()
    {
        if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
        {
            Request.Browser.Adapters.Clear();
        }
    }
paste this code on page load event
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 BillWoodruff 170
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,777
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100