Getting xml generated from ColdFusion

I am trying out the the framework and I created a cfm page
that creates xml to send back to the page. If I goto the page that
generates the xml it loads fine and in IE displays the xml tree.
But when I call the same page using XMLDataSet, I get an
onLoadError... but, if I take the generated xml and save it as an
xml file, it loads just fine... I turned debugging off in CF so the
only thing being written to the page is the xml..
Question 1, why would I get this error? and 2, how do I see
what the error is?

"grumpee" <[email protected]> wrote in
message
news:epb7pf$9ng$[email protected]..
>I am trying out the the framework and I created a cfm
page that creates xml
>to
> send back to the page. If I goto the page that generates
the xml it loads
> fine
> and in IE displays the xml tree. But when I call the
same page using
> XMLDataSet, I get an onLoadError... but, if I take the
generated xml and
> save
> it as an xml file, it loads just fine... I turned
debugging off in CF so
> the
> only thing being written to the page is the xml..
>
> Question 1, why would I get this error? and 2, how do I
see what the error
> is?
Most likely you aren't serving the data using the correct
mime-type. Try add
something like this to your CFML code:
<cfcontent type="application/xml; charset=iso-8859-1">
The code above use iso-8859-1 (Latin-1), change it to the one
that fits your
application (utf-8 or whatever).
This custom tag could also make your life easier:
http://www.olimpo.ch/tmt/tag/spryxml/
Massimo Foti, web-programmer for hire
Tools for ColdFusion and Dreamweaver developers:
http://www.massimocorner.com

Similar Messages

  • Flash won't load xml generated from coldfusion

    I have a swf file that used to load in xml files. It worked
    perfectly fine. However, I then realized it would make more sense
    to have the flash load a cfm file that creates xml on the fly.
    My cfm page is creating perfectly fine xml but the flash
    won't load it. WHY!?
    Here is the path to my xml...
    http://www.flyfishingcommunity.com/newsite/widgets/reports/pictures_widget_fly_fishing.cfm
    In my flash file I load the cfm the way I used to load the
    xml and its not working.

    mikejjr wrote:
    > Ever since I loaded the new Internet Explorer, 7.0, my
    FLASH won't load. When
    > I go to a site requiring FLASH, it tells me that the
    site requires FLASH, and I
    > need to downloaded it from Macromedia... I have download
    it twice, and still
    > NO luck.
    >
    > Any suggestions? Can anyone help?
    adobe.com/support/flash
    look for links for player installation troubleshooting.
    Also make sure that anti spy ware / ad ware and other that
    type
    of tools are not set to block flash content.
    Some of these tools do that by default
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How to include CDATA in xml generated from XQuery

    I need to include Cdata in the xml generated from my xquery which is given below:
    I tried using XMLCDATA, but not getting the desired output. What am I doing wrong?
    SELECT XMLQuery('<InsUpdDel>
    for $crv in ora:view("RELATION")
    return
    <first>
    <eff_date>{$crv/ROW/EFF_DATE/text()}</eff_date>
    <source>{$crv/ROW/SOURCE/text()}</source>
    <key>
    <fld>
    <id>from_type</id>
    <val>XMLCDATA({$crv/ROW/FROM_ENT_TYPE/text()})</val>
    </fld>
    <fld>
    <id>from_ent_id</id>
    <val>{$crv/ROW/FROM_ENT_ID/text()}</val>
    </fld>
    </key>
    </first>}</InsUpdDel>'
    RETURNING CONTENT)
    FROM dual;
    The output I get is XMLCDATA(C), while the desired output is <![CDATA[C]]>

    Forgive me my vanity to think I can contribute by kicking doors open that are probably already wide open....I might create more confusion, but perhaps it helps some of the readers of this thread....
    In general it is not such a good idea to use "string" functions to create (serialized) XML. XML tools (including Oracle XML DB) go through a lot of effort to make sure that when a "native" XML structure is serialized to a string, the XML rules are strictly obeyed (e.g. special character escaping).
    Just assume e.g. that the $i/Reference from above contains something like ]]><
    The resulting XML would not be valid.
    More info on serializing XML in the context of XQuery is available from
    - http://www.w3.org/TR/xquery/#id-serialization
    - http://www.w3.org/TR/xslt-xquery-serialization/
    - http://www.w3.org/TR/xslt-xquery-serialization/#XML_CDATA-SECTION-ELEMENTS
    Unfortunately I do not think Oracle XML DB currently implements these parts of the spec (perhaps 11g will)...leaving the OP's question unanswered.
    Anyway, if going the route of serializing the XML through string functions, it is always good to realize the dangers of such an approach.
    Peter

  • Any way to insert the XML generated from dataTable into the oracle?

    Hi guys,
    I want to know if there is a way to insert the XML generated from dataTable(dataTable.GetXML()) into the oracle?
    Thanks in advance,

    There is o extractor to load assessment cycles; instead you can load dtaa after the assesment cycle is complte in R/3. You can schdeule the job in BW accordingly.
    May I know what exactly is the requirement.
    Ravi Thothadri

  • Getting XML result from Oracle request

    We have Oracle 8i Entreprise Edition and We like to get XML result from an Oracle request. Can I use only Oracle 8i Entreprise Edition product or should i use another oracle product to do this job ?
    Thank you

    Download our XSQL Pages technology with the XSQL Servlet and you'll be in business in no time. If you want to just get XML programmatically from SQL in your own programs, you can try the XML SQL Utility (which XSQL Pages makes use of under the covers). XSQL Pages comes with lots of demos and a tutorial.

  • Getting xml file from web for iPhone App

    Im having an app get an xml file from the web and process it. Ive got the processing part down, ive even got the downloading part done. Problem is so far ive only downloaded a generic xml file hardcoded into the app. I need the user to input a value of the file to get. As a matter of fact, ive been thinking that i may even use the UniqueIdentifier for the iphone to make the file unique enough without the hassle of having to search thru user/pass combinations. So i have the webform to have users enter the values and then their iphones unique ID. But i need to have the user get the unique ID from their phone. Unfortunately ive been able to find this:
    UIDevice *device = [UIDevice currentDevice];
    NSString *uniqueIdentifier = [device uniqueIdentifier];
    [device release];
    NSLog(@"Device GUID:%@", uniqueIdentifier);
    but this number does not show up on the iPhone UserInterface, so my user would have no way of knowing what his/her uniqueIdentifier is
    So my question is 2-fold:
    1. If UniqueIdentifier is the best way to go, how do i have my users visualize their UniqueIdentifier in order to give their xml file that name?
    2. If the user/pass is the best way to go, id have to store user, pass and file name in a database online and have the user create an account which would generate a unique idFilename for him/her and that way fetch the file.

    Hi Marcio -
    I suspect I don't understand your requirements, so if my reply is irrelevant, please tell us a little more about what you're trying to do.
    Marcio Valenzuela wrote:
    1. If UniqueIdentifier is the best way to go, how do i have my users visualize their UniqueIdentifier in order to give their xml file that name?
    I'm not sure what you mean by visualize. If you want the user to see the device id, why not populate a label or text field with it? Otherwise, why not just insert the id into the request yourself? E.g.:
    UIDevice *device = [UIDevice currentDevice];
    NSString *uniqueIdentifier = [device uniqueIdentifier];
    // [device release]; <-- do not release object you don't own
    NSLog(@"Device GUID:%@", uniqueIdentifier);
    textField1.text = uniqueIdentifier; // if we think the user wants to see this
    [self addIdToRequest:uniqueIdentifier]; // implementation is an exercise for the student
    2. If the user/pass is the best way to go, id have to store user, pass and file name in a database online and have the user create an account which would generate a unique idFilename for him/her and that way fetch the file.
    This is up to you. If the download isn't confidential info, it might be ok to rely on the device id. Otherwise you clearly put the owner's info at risk in case someone else operates the device.
    Im having an app get an xml file from the web and process it.
    I'm not sure why you included this info about the downloaded data format, and that's one reason I'm not sure I understand the problem. But I hope the above will help you see what needs to be clarified.
    - Ray

  • Get xml data from a web service into Forms?

    Hello folks! I am reading active directory info from a web service into forms via imported java classes. I can read from functions that return strings just fine, but I have to get the output from getGroupUsers which returns an XmlDataDocument. How do I read this in and parse it in Forms?
    I will be grateful if y'all could point me to an example.
    Thank you,
    Gary
    P.S. Here is a snippet of how I get the full name by passing an ID:
    DECLARE
    jo ora_java.jobject;
    rv varchar2(100);
    BEGIN
    jo := ADSoapClient.new;
    rv := ADSoapClient.getUserName(jo, 'user_ID');
    :block3.fullname := rv;

    Hello,
    Since you are already dealing with server-side JAVA, I would suggest you create a method that would do the parsing server-side and what your PL/SQL will be dealing with is just the return string.
    Here is a method I use to read an XML file (actually, it is an Oracle Reports file converted to XML) and from the string version, I will do search, replace and other things.
    So, from getGroupUsers which returns an XmlDataDocument, you can adapt this method to get your data server-side and let the form module read the output data.
    <blockquote>
    private String processFileXml(String fileName, int iFile) throws ParserConfigurationException, SAXException,
    IOException, XPathExpressionException{
    try{                
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    domFactory.setNamespaceAware(true);
    InputStream inputStream = new FileInputStream(new File(fileName));
    DocumentBuilder builder = domFactory.newDocumentBuilder();
    Document doc = builder.parse(inputStream);
    StringWriter stw = new StringWriter();
    Transformer serializer = TransformerFactory.newInstance().newTransformer();
    serializer.transform(new DOMSource(doc), new StreamResult(stw));
    return stw.toString();
    catch (Exception e){
    System.err.println(e);
    System.exit(0);
    return "OK";
    </blockquote>
    Let me know if this is of nay help.
    Thanks.

  • How can I get xml data from KM?

    Hi guys,
    how can i get a xml data from KM?
    I saved an xml document in KM, and I want to read its content. How can I get this document?
    Using
    DocResource = (IResource) resFactory.getResource(RID.getRID("Document/ Path"),resContext)?
    I want to know which kinds of API of KM are responsible for this.
    Thanks in advance
    Regards,
    Liying

    Hi Liying
    use this code.
    try {
                   IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
                   IUser sapUser = wdClientUser.getSAPUser();
                   com.sapportals.portal.security.usermanagement.IUser ep5User =
                        WPUMFactory.getUserFactory().getEP5User(sapUser);
                   IResourceContext resourseContext = new ResourceContext(ep5User);
                   IResourceFactory resourseFactory = ResourceFactory.getInstance();
                   RID pathRID =
                        RID.getRID(
                             "/documents/"(Path to folder where ur file is"");
                   ICollection collection =
                        (ICollection) resourseFactory.getResource(
                             pathRID,
                             resourseContext);
                   IResourceList resourceList = collection.getChildren();
                   IResourceListIterator resourceListIterator =
                        resourceList.listIterator();
    while (resourceListIterator.hasNext()) {
                        com.sapportals.wcm.repository.IResource resource =
                             resourceListIterator.next();
    try {
                             /*File from KM Reading*/
                             InputStream in = resource.getUnfilteredContent().getInputStream();
                             ByteArrayOutputStream out = new ByteArrayOutputStream();
                             byte[] buffer = new byte[4096];
                             int bytesread = 0;
                             while ((bytesread = in.read(buffer)) != -1) {
                                  out.write(buffer, 0, bytesread);
                             String dataToBeConvertedToXML = out.toString();
    catch(Exception e){}
    catch(Exception e){}
    Award points if found usefull.
    I suppose you have used KM sharing reference in ur application
    Regards
    BP

  • Hi How to get XML file from servlet that XI sent to my J2EE appl?

    Hi All!
    I have a scenario like XI sends xml file to j2ee application. In my J2EE application my servlet receives this xml. Will the xml file be in my HTTPServletRequest object? if so how to get that file from Request object.
    Please help me its urgent, Any code help is highly appreciated.
    My xml file will be like this:
    <ns0:Http_Message_Type_Demo
    xmlns:ns0="http://abcdemo.com">
    <Name>ABC</Name>
    <RollNo>123</RollNo>
    <Address>a-4</Address>
    </ns0:Http_Message_Type_Demo>
    somebody should help me!please
    Thanks

    Hi,
    You can use HTTPServletRequest object to get the XML payload.
    BufferedReader reader = request.getReader(); //gets XML payload
    String line = reader.readLine(); // to read the XML payload line by line
    (request is the HTTPServletRequest object)
    Regards,
    Uma

  • Want to get xml file from external webservice

    hello experts,
    I have to call a webservice only by call a url and get back a xml file as response. I´ll create the complete url with a mapping and tried to call the webservice with http and soap adapter but it doesn´t work. The url is correct and works with my browser.
    https://sh.de.xxxxxxxx.net:443/extranet/levels/?group=Administrator&user=esco&pass=e2999a4f79804301f1134fadb6e0fc2d&salt=1222877335158
    What should I do?
    many thanks for help
    Ulf

    Hi,
    Try following steps:
    1) Ensure that you are having the correct Webservice with you.
    2) Create your IR objects depending on the Webservice that you have (the one which you need to call).
    3) If you are using a HTTP Test Client to send the request then you need not mention any URL there...you just need to give the Sender namespace and Sender Message Interface Name....since you want the response back use QoS as BE...also ensure that other requierd details are correct.
    4) Now since you are using SOAP communication channel at your Receiver side you need to enter a Target URl in the SOAP Channel......now open the Webservice (the one which you need to call)....in this Webservice there will be a field
    <soap:address location="http://xyz......"/>
    copy the contents (http://xyz......) from here and paste it in the Target URL field of your SOAP Channel.
    Now you are ready to test your scenario.
    Regarding your other Qs:
    is the soap receiver adapter correct for this scenario? <<Yes>>
    I only have the response xml structure but not as file and no request structure.<<You said that you have created the necessary mappings, so you can enter the required data in the Test Tab of your Message mapping....copy the data into your HTTP client and do the testing>> 
    how do I get the url from my mapping as url for a request? <<no need for a URL....where will you use it??>>
    do I have to create a new wsdl for this? <<no>>
    revert back if you have any queries.
    Regards,
    Abhishek.

  • Getting XML back from xMII from a HTTP POST

    I have a need to get just XML data from xMII. Ideally, I would go to xMII with a properly formatted HTTP POST and get back an xml payload with the results of the QT execution. How do I do this?

    This may help:
    <a href="/people/abesh.bhattacharjee/blog/2007/03/05/ajax-xmii-illuminator-services-a-database-browser:///people/abesh.bhattacharjee/blog/2007/03/05/ajax-xmii-illuminator-services-a-database-browser

  • Problem in Flex to get XML result from web services

    Hi all
    I am struggling a proplem for a whole day, i hope somebody can help.
    I am trying to get the list file of files located on the server, so i use flex to access a ASP.NET ASMX web services, that returns all the file names in a folder.
    I can see that web servicese worked perfectly, however when i try to get the result from flex, i could not figure out how to get the real data i wantted
    public function LoadImage(e:ResultEvent):void{
    imageList.dataProvider = e.result;
    the e.result has some addtional tags, such as
    <GetImageFileListResponse xmlns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <GetImageFileListResult>
        <images>
          <image>01417_ccurve_1280x1024.jpg</image>
          <image>1915619295407381096.png</image>
          <image>21051802471898733113.png</image>
    where GetImageFileList is the operation name used in web service
    I am only interested in the data starting from <images> . I don't know why the addtioanl tag has been added.
    here is the code i have used in flex.
    <mx:WebService 
    wsdl="http://localhost/Flex/GetImageFiles.asmx?WSDL" id="imageWs">
    <mx:operation name="GetImageFileList" result="LoadImage(event)" fault="mx.controls.Alert.show(event.fault.faultString)" resultFormat="
    e4x">
    </mx:operation>
    </mx:WebService> 
    Thanks in advance!!!

    Hi,
    Just replace the below line in your code and check...
    imageList.dataProvider = e.result.GetImageFileListResult.images;
    If this post answers your question or helps, please mark it as such.
    Thanks,
    Bhasker Chari

  • How can i get xml data from html

    Hi
    i need to submit data from an html form to server via xml.
    ( ie data shold be in xml format instead of POST/GET methods )
    how can i can i make this happen ?
    Renjith.

    read the excellent suggestion from mochamaniac (reply 2 of 5): http://forum.java.sun.com/thread.jsp?forum=34&thread=303120
    ps. next time run a search on the forum prior from posting ;-)

  • Where is XML generated from PO Output for Communication

    I looked in $COMMON_TOP/admin/out and opened orequestid.out file, but its not xml
    can someone tell me where does it get stored ?
    thanks

    Hi,
    I am not using a barcode font. I am using RenderX's XSL stylesheets to generate the barcode. As I said, the barcode generate's fine in the PDF on my computer but does not appear in the PDF when the code is moved to Oracle.
    Thanks,
    Suzanne

  • XML alignment problem when opening with notepad - XML generated from SAP

    Hi all,
    I am sending a mail with attachment as XML format by using the function module SO_NEW_DOCUMENT_ATT_SEND_API1.
    I am getting the xml file in mail and it was properly aligned when i open it. But when i open it with notepad the alignments are changing. 
    Below is the code for sending a mail. The content of the XML file populaed in int. table  lt_attachment.
    lt_attachment[] = pt_attachment[].
      LOOP AT lt_attachment INTO ls_attachment.
        ls_objtxt-line = ls_attachment-container.
        APPEND ls_objtxt TO lt_objtxt.
        CLEAR : ls_attachment, ls_objtxt.
      ENDLOOP.
    Creating the document to be sent
      ls_mailsubject-obj_name     = 'MAILATTCH'.
      ls_mailsubject-obj_langu    = sy-langu.
      ls_mailsubject-obj_descr    = 'You have got mail'.
      ls_mailsubject-sensitivty   = 'F'.
      lv_cnt = LINES( lt_objtxt ).
      ls_mailsubject-doc_size     = ( lv_cnt - 1 ) * 255 + STRLEN( ls_objtxt ).
      DESCRIBE TABLE lt_objtxt LINES lv_tab_lines.
    Header of the email
      ls_objpack-transf_bin = space.
      ls_objpack-head_start = 1.
      ls_objpack-head_num   = 0.
      ls_objpack-body_start = 1.
      ls_objpack-body_num   = lv_tab_lines.
      ls_objpack-doc_type   = lc_raw.
      APPEND ls_objpack TO lt_objpack.
      CLEAR ls_objpack.
      ls_objpack-transf_bin = lc_x.
      ls_objpack-head_start = 1.
      ls_objpack-head_num   = 1.
      ls_objpack-body_start = 1.
      ls_objpack-body_num   = lv_tab_lines.
      ls_objpack-doc_type   = 'XML'.
      ls_objpack-obj_name   = 'data'.
      ls_objpack-obj_descr  = 'data'.
      ls_objpack-doc_size   = ls_objpack-body_num * 255.
      APPEND ls_objpack TO lt_objpack.
      CLEAR ls_objpack.
    Add Recipients
      ls_reclist-rec_type = 'U'.
      ls_reclist-com_type  = 'INT'.
      ls_reclist-receiver =  pv_mail.
      APPEND  ls_reclist TO lt_reclist.
    Mail Contents
      ls_mailtxt-line = 'Please find attached your XML doc.'.
      APPEND ls_mailtxt TO lt_mailtxt.
      CLEAR ls_mailtxt.
      ls_mailtxt-line = lc_regards.
      APPEND ls_mailtxt TO lt_mailtxt.
      CLEAR ls_mailtxt.
      ls_mailtxt-line = lc_dewa.
      APPEND ls_mailtxt TO lt_mailtxt.
      CLEAR ls_mailtxt.
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = ls_mailsubject
         put_in_outbox              = lc_x
         commit_work                = lc_x
        TABLES
          packing_list               = lt_objpack
          contents_bin               = lt_objtxt
          contents_txt               = lt_mailtxt
          receivers                  = lt_reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc EQ 0.
        COMMIT WORK.
        SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
        pv_return = 'Success'.
      ELSE.
        pv_return = 'Failed'.
      ENDIF.
      CLEAR: ls_objtxt,ls_reclist, ls_objpack ,ls_doc_chng.
      REFRESH: lt_objtxt,lt_reclist,lt_objpack.
    Could any one help me on this.
    Thanks & Regards,
    Vineel.

    Can't you PREVIEW your question before posting? Here you have more than 2500 characters, so we can't read your code.
    Your "problem" seems normal to me (you shouldn't open an XML file with Notepad). Could you give an example how it looks like and how you'd like to make it appear?

Maybe you are looking for

  • My camera on my iPad is vert grainy, bad pictures. How can I fix it. It's a ipad2

    Help, if you can my camera on my iPad 2 is bad ! Very grainy, every scents I updated the picture is bad.

  • Games on Touch won't play

    Yesterday, everything was working fine. I sync'd last night, and when I went to play the games on my Touch...nothing. The game seems like it's going to start, but then it just goes back to the main apps menu screen.

  • Fund Flow & cash Flow

    hi... whr we can get Fund Flow & cash Flow in system? Thanks & Regards Rekha sharma

  • With a bluetooth phone...

    after 9 months of having a MBP i think i have finally lost my Apple Remote! i'm suprised i didnt lose it earlier really, but anyway - as they cost a good £20; i would like to control the Front Row Interface with my Bluetooth mobile phone is this poss

  • Broadcasting from Portal - Email Zip Functionality Issue

    Hi, After upgrading to BW 7.01 SP7, the functionality to send a zip broadcast email with multiple Excel files is not working properly.  The broadcast setting in question is based off a query, and is using control query functionality to send out multi