Solved

create html from web service that returns xml

Posted on 2009-04-15
3
212 Views
Last Modified: 2012-05-06
I am trying to create an html select tag based on the results I get back from a web service.  The web services creates the html.  I get the return string and want to place it in my web page.  I am getting a string back but it is not showing up as html but just as a string.  This is the results from the web service:

  <?xml version="1.0" encoding="utf-8" ?>
  <string xmlns="http://audintranet/SIREJVSvc"><SELECT id='OpenAcctgPeriodsSelect' onChange='GetJVNo();'><OPTION value='4,2009'>April 2009</OPTION></SELECT></string>

What shows up in the web page is the select statement as a string.  The way I place it in the page is by the following:

document.getelementbyid("myDiv").innerHTML = httpResponse.responseText

How in the world do I get my string to show up as html?
0
Comment
Question by:audExpert
  • 2
3 Comments
 
LVL 12

Expert Comment

by:Gibu George
Comment Utility
you need to set the respponse content type to text/html
0
 

Accepted Solution

by:
audExpert earned 0 total points
Comment Utility
Maybe that works.  I ended up doing this:

 var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async="false";
        xmlDoc.loadXML(xmlHttp.responseText);
        document.getElementById("JVNo").innerHTML=xmlDoc.getElementsByTagName("string")[0].childNodes[0].nodeValue;
0
 

Author Comment

by:audExpert
Comment Utility
Found own solution. Please see mylast comment.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Ajax not completing 11 73
VB.NET and XML parsing 6 54
RSS is valid, but improvement recommendations are confusing. 3 24
XSLT Help 12 19
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now