Dynamic xml from php script throws error: #1088 or #1085

Hi,
I'm importing xml formatted data from mysql via php script:
[code]
<?php
require_once('require.php');
$result = mysql_query("SELECT * FROM `songs`");
if($result)
    header ("Content-Type: text/xml");
    echo"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
    echo"<songComments>\n";
    while ($row = mysql_fetch_array($result))
        echo"<testimonial>\n";
        echo"<songComment>" . $row['title'] . "</songComment>\n";
        echo"</testimonial>\n";
    echo"</songComments>\n";
?>
[/code]
In one of my flash projects it's working just fine. But in the new one that I just sterted not anymore. And i have no idea why. I get this errors:
TypeError: Error #1085: The element type "songComments\n" must be terminated by the matching end-tag "</songComments\n>".
or:
TypeError: Error #1088: The markup in the document following the root element must be well-formed.
When I output that php into txt file and loaded in flash everything is fine, but not from php script directly.
Could it have something to do with that I'm testing that mysql locally on my computer using WAMP ? Previous project got all data from mysql from server.

Ho could I trace what flash sees?
var url:URLLoader = new URLLoader();
url.addEventListener(Event.COMPLETE, xmlLoaded);
url.load(new URLRequest("getDataFromDB.php"));
private function xmlLoaded(event:Event):void {
            myXML = new XML(event.target.data);
            trace(myXML);
I  got rid of that \n everywhere or move them around  and it's still the same error 1088 or 1085

Similar Messages

  • How to fill my collapsible panels with dynamic content from PHP scripts?

    Hi people,
    I'm trying to generate dynamically generated content in a
    Spry collapsible panel. Previously I've generated PHP files that as
    an output generates a dynamic table with the data I want to show. I
    figured it would be possible to use an php include option to
    generate this table in a content section of a Spry collapsible
    panel. However, when I do this the collapsible panels appear to
    join and when panel1 is clicked all tables close instead of only
    panel 1 and all tables are put benath each other without putting it
    in each seperate panel. But when i replace the file with only the
    text "content" it works fine. Do i maybe have to add some kind of
    command at the end of my php file to make it look like the
    "content"-text or is this not the problem?
    I've been looking for the answer now for a couple of weeks on
    various forums and nothing seemed to work for me. Can please
    somebody help me out?
    Greets,
    Damian
    The code in its non working form:
    <head>
    <!--Link the CSS style sheet that styles the Collapsible
    Panel-->
    <link href="SpryAssets/SpryCollapsiblePanel.css"
    rel="stylesheet"
    type="text/css" />
    <!--Link the Spry Collapsible Panel JavaScript
    library-->
    <script src="SpryAssets/SpryCollapsiblePanel.js"
    type="text/javascript"></script>
    </head>
    <body>
    <!--Create the Collapsible Panel widget and assign
    classes to each element-->
    <div id="CollapsiblePanel1" class="CollapsiblePanel1">
    <div class="CollapsiblePanelTab">Tab</div>
    <div class="CollapsiblePanelContent"><?php
    include('details_books.php');?></div>
    </div>
    <div id="CollapsiblePanel2" class="CollapsiblePanel2">
    <div class="CollapsiblePanelTab">Tab</div>
    <div class="CollapsiblePanelContent"><?php
    include('details_authors.php');?></div>
    </div>
    <!--Initialize the Collapsible Panel widget object-->
    <script type="text/javascript">
    var CollapsiblePanel1 = new
    Spry.Widget.CollapsiblePanel("CollapsiblePanel1");
    </script>
    <script type="text/javascript">
    var CollapsiblePanel2 = new
    Spry.Widget.CollapsiblePanel("CollapsiblePanel2");
    </script>
    </body>

    you need to save the page as a php page (.php) It works
    fine

  • Command to Export project as Final Cut Pro XML from jsx script

    Hi All,
    Can somebody get me the command to export the project as final cut pro xml from jsx script.
    I was using the extension builder script earlier for cs6 panel development, so we were using pjct.exportFinalCutProXML("pathname");
    Now I am working for panel in Premiere CC so working on HTML 5 panel and qe dom scripting(.jsx).
    In some jsx examples i got there is script to export sequence as final cut pro xml but cannot get the code for project export.
    project.activeSequence.exportAsFinalCutProXML(entire_out_path);
    Also please let me know if there are any kind of reference available about all the functions and properties in the pe dom scripting for premiere pro cc.
    I am using premiere pro cc 7.1, windows 7, Eclipse Kepler.
    Thanks in advance,
    Anoop NR

    When you reimport the exported project XML to FCP, do you get the full project or just the single bin/sequence? If you get the full project then it sounds like you need Premiere help, not FCP help ... have you tried asking on the Adobe forums? If you only get the single bin/sequence then it seems you might have inadvertently selected those prior to creating the project export. Try making sure that your FCP Browser window is active and that you have not selected anything within that window prior to using the File > Export > XML command. If that still causes issue then you might try using an earlier FCP XML version.
    Hope it helps
    Andy

  • ADC PHP enabling shell script throws errors

    Hi, guys.
    I recently tried to enable PHP on my MacBook Pro.
    I speak some bash, but no AppleScript.
    On the Apple Developer Center they write you a little script to enable PHP, which failed repeatedly before numerous edits by me. I eventually massaged the script to work, but I want to understand *why* the script didn't work.
    The code they give is as follows (and you can find it here: http://developer.apple.com/mac/articles/internet/phpeasyway.html):
    set admin_email to (do shell script "defaults read AddressBookMe ExistingEmailAddress")
    user_www=$HOME/Sites
    filename=php-test
    user_index=${user_www}/${filename}.php
    user_db=${user_www}/${filename}-db.sqlite3
    # NOTE: Having a writeable database in your home directory can be a security risk!
    conf=`apachectl -V | awk -F= '/SERVER_CONFIG/ {print \$2}'| sed 's/"//g'`
    conf_old=$conf.$$
    conf_new=/tmp/php_conf.new
    touch $user_db
    chmod a+r $user_index
    chmod a+w $user_db
    chmod a+w $user_www
    echo "Enabling PHP in $conf ..."
    sed '/#LoadModule php5_module/s/#LoadModule/LoadModule/' $conf | sed
    "s^[email protected]^\$admin_email^" > $conf_new
    echo "(Re)Starting Apache ..."
    osascript <<EOF
    do shell script "/bin/mv -f $conf $conf_old; /bin/mv $conf_new $conf;
    /usr/sbin/apachectl restart" with administrator privileges
    EOF
    Here are where this code throws errors for me:
    First:
    set admin_email to (do shell script "defaults read AddressBookMe ExistingEmailAddress")
    I don't even recognize the shell syntax that this would work in. It's sort of csh like. Is this AppleScript?
    Anyway, OS X bash chokes on this at the first '(' and I changed it to:
    admin_email=`defaults read AddressBookMe ExistingEmailAddress`
    which works just fine.
    Second:
    chmod a+r $user_index
    I have no idea how his is supposed to work without 'touch $user_index'
    I added:
    touch $user_index
    to the script.
    Third:
    conf=`apachectl -V | awk -F= '/SERVER_CONFIG/ {print \$2}'| sed 's/"//g'`
    Okay, this actually *works*, but I don't know why it should. In my book, it should choke on the \$2, because the \ is invalid.
    I've left it because it works and if it works it isn't wrong, but I would have written:
    conf=`apachectl -V | awk -F= '/SERVER_CONFIG_FILE/ {print $2}' | sed 's/"//g'`
    which I've tested and also works.
    I'd like to know why Apple's first line works.
    Fourth:
    sed '/#LoadModule php5_module/s/#LoadModule/LoadModule/' $conf | sed "s^[email protected]^\$admin_email^" > $conf_new
    The error here is that:
    sed "s^[email protected]^\$admin_email^"
    doesn't replace [email protected] with the contents of $admin_email.
    I don't know what the and are supposed to do, but this just replaces the string '[email protected]' with the string '\$admin_email'
    I replaced this with:
    sed 's^[email protected]^'$admin_email'^'
    This gives me a final script of:
    #!/bin/sh
    admin_email=`defaults read AddressBookMe ExistingEmailAddress`
    user_www=$HOME/Sites
    filename=php-test
    user_index=${user_www}/${filename}.php
    user_db=${user_www}/${filename}-db.sqlite3
    conf=`apachectl -V | awk -F= '/SERVER_CONFIG/ {print $2}'| sed 's/"//g'`
    conf_old=$conf.$$
    conf_new=/tmp/php_conf.new
    touch $user_index
    touch $user_db
    chmod a+r $user_index
    chmod a+w $user_db
    chmod a+w $user_www
    echo "Enabling PHP in $conf ..."
    sed '/#LoadModule php5_module/s/#LoadModule/LoadModule/' $conf | sed 's^[email protected]^'$admin_email'^' > $conf_new
    echo "(Re)Starting Apache..."
    osascript <<EOF
    do shell script "/bin/mv -f $conf $conf_old; /bin/mv $conf_new $conf; /usr/sbin/apachectl restart" with administrator privileges
    EOF
    which works just fine.
    But I'm still confused - why did ADC have a code snippet that could have never worked? Or am I missing something obvious?
    - Nathan

    Hey, RanjeetJones!
    You're probably right - it's a lot of code to uncomment a line and change the administrator setting.
    And the first time I set up PHP, I just found and edited the config file.
    But the script had me so confounded I went back to troubleshoot it and got all wrapped up in why it ended up that way.
    And this will help the next coder who wants to learn PHP and maybe doesn't speak bash.
    - Nathan

  • Script throwing error" Object required: 'API'

    Hi All,
    We need help in one issue. We have following script which is running fine when we ran it from script editor, but when use this as expression in import format is throwing error
    Error: An error occurred importing the file.
    Detail: Object required: 'API'
    At line: 12
    Script:
    Function ME_to_LE(strField, strRecord)
    ME_to_LE =API.SqlMgr.fMapItemLookup (749, "UD8", Left(strField,3))
    End Function
    We have created few other Scripts which are running fine and producing required result when we check them with MsgBox. But when we are using these scripts in import format it is saying: Object required: 'API'
    IF I can not use API object in import script, how can I process multiple column with one script. We need to derive three-four column based on one input column and we don't want to write separate import script for each column. How and where we can write this script?
    Are we missing any step? Any help will be highly appreciated. Looks I asked long question :)
    Thanks,
    Shivendra
    Edited by: shiv2 on Sep 16, 2011 9:30 AM
    Edited by: shiv2 on Sep 16, 2011 10:36 AM

    Hi Robb,
    "It looks like you and James are on the same project" That is correct.
    OK. In requirment we have three-four column based on these column we need to derive few other column. We want to do spilitting and validation in Import itself. This is mainly a Validation requirment.
    There is one column which may have 12,13,14,17 or any other number of character in it. first three will represent one dimension but exact value be a mapped result based on these three digits.
    There are many validation based on the number on charaters and most importantly we don't want to process other column is validation get failed at any stage.
    Do we have anything like Import Action? Probably we want to change that script. Or if we can write something like integration script. We need every column to be processed in one shot.
    I don't think it is self explantry. Can we have your email please?
    Thanks,
    Shivendra
    Edited by: shiv2 on Sep 16, 2011 8:52 PM

  • Calling stored procedure from php script.

    I have the following stored procedure in Oracle 8:
    CREATE OR REPLACE procedure kunde_create
    (iname1 in varchar2,
    iname2 in varchar2,
    iname3 in varchar2,
    ianrede in number,
    istrasse in varchar2,
    iland varchar2,
    iplz in varchar2,
    iort in varchar2,
    iortsteil in varchar2,
    itelefon in varchar2,
    iemail in varchar2,
    itelefax in varchar2,
    imobil in varchar2,
    ianrufer in varchar2,
    izusinfo in varchar2,
    izusatz2 in varchar2,
    okdnr out varchar2)
    is
    vkndnr number;
    vadrnr number;
    vkdnr varchar2(15);
    ikugru constant number:=4;
    minkdnr constant varchar2(15):='44000000';
    maxkdnr constant varchar2(15):='50000000';
    begin
    ..... SOME CODE ....
    okdnr:='something_to_output';
    commit;
    end kunde_create;
    I am trying to call this SP from a php script, in this way:
    $connection = ora_logon("username@db", "password");
    $cursor = ora_open($connection);
    ora_commitoff($connection);
    $cu=ora_parse($cursor, "begin KW.kunde_create ( :Sta_nameD, :Sta_name2D, :Sta_kugruD, :ianredeD, :Sta_straD, :Sta_landD, :Sta_plzD, :Sta_ortD, :Sta_ortsteilD, :Sta_telD, :Sta_mailD, :Sta_faxD, :Sta_tel2D, :Sta_anruD, :Sta_zusD, :Sta_zus2D ,:okdnr); end;");
    ora_bind($cursor, ":Sta_nameD", $Sta_nameD, 32, 1);
    ora_bind($cursor, ":Sta_name2D", $Sta_name2D, 32, 1);
    ora_bind($cursor, ":ianredeD", $ianredeD, 32, 1);
    ora_bind($cursor, ":Sta_straD", $Sta_straD, 32, 1);
    ora_bind($cursor, ":Sta_landD", $Sta_landD, 32, 1);
    ora_bind($cursor, ":Sta_plzD", $Sta_plzD, 32, 1);
    ora_bind($cursor, ":Sta_ortD", $Sta_ortD, 32, 1);
    ora_bind($cursor, ":Sta_ortsteilD", $Sta_ortsteilD, 32, 1);
    ora_bind($cursor, ":Sta_telD", $Sta_telD, 32, 1);
    ora_bind($cursor, ":Sta_mailD", $Sta_mailD, 32, 1);
    ora_bind($cursor, ":Sta_faxD", $Sta_faxD, 32, 1);
    ora_bind($cursor, ":Sta_tel2D", $Sta_tel2D, 32, 1);
    ora_bind($cursor, ":Sta_anruD", $Sta_anruD, 32, 1);
    ora_bind($cursor, ":Sta_zusD", $Sta_zusD, 32, 1);
    ora_bind($cursor, ":Sta_zus2D", $Sta_zus2D, 32, 1);
    ora_bind($cursor, ":okdnr", $okdnr, 32, 2);
    ora_exec($cursor); //Line 93
    This code brings me back this error:
    Warning: Can't find variable for parameter in /www/vaillant/htdocs/www_tisweb/html/php/testdb/connect.php on line 93
    I tried nearlly everything, but it doesnt work :(
    Can anybody help me please.
    Thanx in advance,
    Ahmed Adaileh

    I had to make a few modifications to get your example to work. The
    biggest change was to the ora_bind syntax. I also found I had to
    define a variable to hold the OUT value before doing the ora_exec.
    Otherwise I got the error you saw. I'm not sure why defining it first
    is necessary. I didn't dig deeply into PHP's oracle.c code.
    My final script is below. It displays "okdnr is something_to_output".
    I tested using PHP 4.3.3 against Oracle 9.2.
    The best general suggestion I can make is to use PHP's oci8 driver
    unless you need to be compatible with existing PHP code. There is an
    example of using OUT binds in oci8 to call a stored procedure at
    PHP and serveroutput
    -- CJ
    <?php
    // Changed connection details to suit my environment
    $connection = ora_logon("scott@MYDB", "tiger");
    $cursor = ora_open($connection);
    ora_commitoff($connection);
    // Changed schema to SCOTT to match who I'd created the procedure as
    $cu=ora_parse($cursor, "begin SCOTT.kunde_create ( :Sta_nameD, :Sta_name2D, :Sta_kugruD, :ianredeD, :Sta_straD, :Sta_landD, :Sta_plzD, :Sta_ortD, :Sta_ortsteilD, :Sta_telD, :Sta_mailD, :Sta_faxD, :Sta_tel2D, :Sta_anruD, :Sta_zusD, :Sta_zus2D ,:okdnr); end;");
    // Allocated the IN parameter variables
    $Sta_nameD      = 'a';
    $Sta_name2D     = 'a';
    $ianredeD       = 1;
    $Sta_straD      = 'a';
    $Sta_landD      = 'a';
    $Sta_plzD       = 'a';
    $Sta_ortD       = 'a';
    $Sta_ortsteilD  = 'a';
    $Sta_telD       = 'a';
    $Sta_mailD      = 'a';
    $Sta_faxD       = 'a';
    $Sta_tel2D      = 'a';
    $Sta_anruD      = 'a';
    $Sta_zusD       = 'a';
    $Sta_zus2D      = 'a';
    $Sta_kugruD     = 'a';
    // Changed ora_bind syntax to match
    // http://www.php.net/manual/en/function.ora-bind.php
    ora_bind($cursor, "Sta_nameD", ":Sta_nameD", 32, 1);
    ora_bind($cursor, "Sta_name2D", ":Sta_name2D", 32, 1);
    // Change ianredeD type to 2 to match procedure definition
    ora_bind($cursor, "ianredeD", ":ianredeD", 32, 2);
    ora_bind($cursor, "Sta_straD", ":Sta_straD", 32, 1);
    ora_bind($cursor, "Sta_landD", ":Sta_landD", 32, 1);
    ora_bind($cursor, "Sta_plzD", ":Sta_plzD", 32, 1);
    ora_bind($cursor, "Sta_ortD", ":Sta_ortD", 32, 1);
    ora_bind($cursor, "Sta_ortsteilD", ":Sta_ortsteilD", 32, 1);
    ora_bind($cursor, "Sta_telD", ":Sta_telD", 32, 1);
    ora_bind($cursor, "Sta_mailD", ":Sta_mailD", 32, 1);
    ora_bind($cursor, "Sta_faxD", ":Sta_faxD", 32, 1);
    ora_bind($cursor, "Sta_tel2D", ":Sta_tel2D", 32, 1);
    ora_bind($cursor, "Sta_anruD", ":Sta_anruD", 32, 1);
    ora_bind($cursor, "Sta_zusD", ":Sta_zusD", 32, 1);
    ora_bind($cursor, "Sta_zus2D", ":Sta_zus2D", 32, 1);
    // Changed okdnr type to 1 to match procedure definition
    ora_bind($cursor, "okdnr", ":okdnr", 32, 1);
    // Bound missing parameter
    ora_bind($cursor, "Sta_kugruD", ":Sta_kugruD", 32, 1);
    // Preallocated the output variable - I'm not sure why this is
    // necessary nor what size is needed.
    // When this line is commented out I get:
    //   Warning: Can't find variable for parameter in test01.php on line XX
    $okdnr = "a";
    ora_exec($cursor);
    print "okdnr is $okdnr";
    ?>

  • Trouble accessing dynamic XML from API with a CFC

    Please see my example at
    http://67.199.18.39/test.html
    and view source (to big to post here). I am returning XML from a
    dynamic call to an API through a ColdFusion CFC.
    Search for something generic like Dog. Click Go. I display
    the XML for you to view. I have tried many different XMLList
    dataproviders but can't get anything to work.
    Can someone point out the "errors" of my ways?
    Thanks.

    Turns out it was a namespace issue. I found the answer from a
    Bruce Phillips tutorial at
    http://www.brucephillips.name/blog/index.cfm/2006/12/5/Processing-XML-in-Flex-20-Using-The -For-Each-Statement-And-The-Descendent-Accessor--Operator
    I had to add:
    private namespace yahooNS = "urn:yahoo:prods";
    use namespace yahooNS;

  • Strange variables retrieved from php script

    Hi,
    I am experiencing a really strange thing when making my flash
    movie communicate with a php script.
    No matter what the animation is doing, just consider the
    following :
    see code below
    ticket is the object which receives the response from server
    which returns
    echo utf8_encode("reponse=ok")
    Each time when I run it , (ticket.retour.toString() != "ok")
    returns true, and the redirection url shows the following :
    http://xx.yy.zz.uu/jeu_avertissement.php?type=PROBLEME_CONNECTION&retour=ok&d=0.02&u=1&k=7 39f4db19af87cc0f2b72a6f63698500
    showing value of my retour var which is equal to .... ok
    I really don't understand! Could anybody explain me what
    happened. It looks like I saw a UFO.
    Thanks in advance,
    Pascal

    Damn it i found :D
    i had to write :
    for (i=0; i<_root.tab_result.liste_lenght; i++) {
    myCB.addItem(_root.tab_result['ville'+i],_root.tab_result['ville'+i]);
    I just hope it could help someone else ahahha
    Bye ;)
    Séb.

  • Accessing passed arguments from php script?

    I have a php script which will pass an argument which I need
    to turn in to a coldfusion variable, how should I go about doing
    this?

    I am developing a cf application to interface with the PLESK
    control panel's Event manager to dynamically setup cf security
    sandboxes when a new domain is added to PLESK. Plesk uses encrypted
    php3 files and with the use of the event manager API I can pass the
    new domain name to any script. However, I cannot alter the way
    PLESK sends the param <new domain> therefore a cfhttp post is
    impossible. All I can do is path the new domain as an argument to
    the file IE: myscript.cfm.
    I have tested passing the new domain to a bash shell script
    and then using bash to drop the new domain name into a database
    then using CURL to execute the .cfm file which sets up the new
    sandbox. This is tested and working on Linux servers but now my
    task is to do the same for Windows servers, hence I would prefer to
    keep all the coding under cf

  • Concat Variables from php script

    Hi everyone !
    Here is my problem,
    My php script return me something like :
    Town1='blabla'&Town2='bloublou' etc...
    I'd like to add each town (loaded by LoadVars) in a ComboBox.
    here is my script (in AS2) :
    for (i=0; i<_root.tab_result.liste_lenght; i++) {
    myCB.addItem(_root['tab_result.ville'+i],_root['tab_result.ville'+i]);
    But i don't manage to concat the first part of the variable
    name 'Town' and the value of i !
    If somebody could help me ... :D thanks a lot.
    Ps if it can help here is the result of
    _root.tab_result.toString()...
    ville30=%27VERNEUIL%2DSUR%2DSERRE%27&ville29=%27VAUCELLES%2DET%2DBEFFECO%27&ville28=%27URC EL%27&ville27=%27ROYAUCOURT%2DET%2DCHAILV%27&ville26=%27PARGNY%2DFILAIN%27&ville25=%27MONT BAVIN%27&ville24=%27MONS%2DEN%2DLAONNOIS%27&ville23=%27MONAMPTEUIL%27&ville22=%27MOLINCHAR T%27&ville21=%27MERLIEUX%2DET%2DFOUQUERO%27&ville20=%27LIERVAL%27&ville19=%27LAON%27&ville 18=%27LANISCOURT%27&ville17=%27FILAIN%27&ville16=%27ETOUVELLES%27&ville15=%27CLACY%2DET%2D THIERRET%27&ville14=%27CHIVY%2DLES%2DETOUVELLES%27&ville13=%27CHEVREGNY%27&ville12=%27CHER Y%2DLES%2DPOUILLY%27&ville11=%27CHERET%27&ville10=%27CHAVIGNON%27&ville9=%27CHAMBRY%27&vil le8=%27CHAILLEVOIS%27&ville7=%27BUCY%2DLES%2DCERNY%27&ville6=%27BRIE%27&ville5=%27BRAYE%2D EN%2DLAONNOIS%27&ville4=%27BOURGUIGNON%2DSOUS%2DMON%27&ville3=%27BARENTON%2DCEL%27&ville2= %27BARENTON%2DBUGNY%27&ville1=%27AULNOIS%2DSOUS%2DLAON%27&ville0=%27ARRANCY%27&liste%5Flen ght=31&envoi=precision&onLoad=%5Btype%20Function%5D

    Damn it i found :D
    i had to write :
    for (i=0; i<_root.tab_result.liste_lenght; i++) {
    myCB.addItem(_root.tab_result['ville'+i],_root.tab_result['ville'+i]);
    I just hope it could help someone else ahahha
    Bye ;)
    Séb.

  • Selecting a Role from dropdown list throws error

    Hi,
    I'm using CRM Web UI 7.0. I'm facing problem selecting a Role from dropdown list in the assignment block Roles in the screen Employee. The problem is that the dropdown list doesn't show any value on clicking and gives an error message "Error on page" at the bottom of page. The roles exist in the system and also I'm able to see them for Accounts screen & in the GUI.
    Kindly help.
    Regards,
    Shaili

    Hi,
    Just to add to this issue: WebUI-> Account Management-> Contacts-> Roles-> Edit list. When we try to add a role from dropdown in Firefox, it works fine but same throws an error in Internet Explorer related to some script.
    Did someone face similar issue and how was it solved?
    Regards,
    Shikha

  • Read XML from Azure CDN Marshalled error

    I would like to load an XML file stored in Azure CDN in a Windows 8.1 App. This code throws Marshaling error:The application called an interface that was marshalled for a different thread. (Exception from HRESULT:
    0x8001010E (RPC_E_WRONG_THREAD))
           public async Task<XDocument> LoadXmlFromCDNAsync()
      var url = new Uri("http://azXXXXXX.vo.msecnd.net/cdn/Data.xml");
                var handler = new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip };
                var client = new HttpClient(handler);
                XDocument doc = new XDocument();
                using (var stream = await client.GetStreamAsync(url))
                    doc = XDocument.Load(stream);
                return doc;
    Thanks.
    FS

    Hi,
    I test your codes. And the result below:
    I can successfully load the XML file. I think there is no problem in the codes which you used to load an XML file.
    And as the error says, the problem is the thread on which the call occurs: the app cannot manipulate UI elements from non-UI threads.  That error usually means you are calling something that requires the UI thread from a different thread. You can
    call Dispatcher.RunAsync to marshall a task back to the UI thread.
    See
    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.core.coredispatcher.runasync.aspx
    And see the thread below:
    https://social.msdn.microsoft.com/Forums/en-US/f1fe027f-2c6c-4a22-9418-566fcf67cebe/the-application-called-an-interface-that-was-marshalled-for-a-different-thread?forum=winappswithcsharp
    Best Wishes!
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
    href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

  • Network Utilization script throws error after re-executing

    Hi everyone, I have a piece of code that finds the network util of a fileserver and if it is over 75% it stops executing the script. The script works the first time but after re-executing it, it throws an error. I've tried to null out all the variables I'm
    using but it still won't work. Any help is appreciated! Thanks!
    Code:
    #Determines NIC utilization
    $interfacebw = $null
    $intbwbytes =$null
    $currentbytespersec = $null
    $linkutil = $null
    Write-Host "Determining File Server Network Utilization.."
    $interfacebw = Get-WmiObject -class Win32_PerfFormattedData_Tcpip_NetworkInterface -ComputerName tsvc2552101x001 | where {$_.Name -eq "Broadcom NetXtreme Gigabit Ethernet"} |select CurrentBandwidth
    $intbwbytes = $interfacebw.currentbandwidth /8
    $currentbytespersec = Get-WmiObject -class Win32_PerfFormattedData_Tcpip_NetworkInterface -ComputerName tsvc2552101x001 | where {$_.Name -eq "Broadcom NetXtreme Gigabit Ethernet"} |select BytesTotalPersec
    [int]$currentbytespersec = $currentbytespersec.bytestotalpersec
    if($currentbytespersec -le 0){
    [int]$linkutil = 0
    }else{
    [int]$linkutil = ($currentbytespersec / $intbwbytes) * 100
    #if NIC util is over 75 then it closes program
    if($linkutil -gt 75){
    $wshell.Popup("Network utilization over 75%, please try again later.",0,"Error",0x1) | Out-Null
    $formSoftwareInstaller.Close()
    return
    Error:
    Cannot convert value "@{BytesTotalPersec=3560}" to type "System.Int32". Error: "Cannot convert the "@{BytesTotalPersec=3560}" value of type "Selected.System.Management.ManagementObject" to type "System.Int32"."
    At C:\Users\cody-horton\Desktop\Software Installer.ps1:406 char:9
    + $currentbytespersec = Get-WmiObject -class Win32_PerfFormattedData_Tcpip ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : MetadataError: (:) [], ArgumentTransformationMetadataException
    + FullyQualifiedErrorId : RuntimeException

    This is all you need to do.  You are way over coding this.
    Write-Host "Determining File Server Network Utilization.."
    $perfdata=Get-WmiObject -class Win32_PerfFormattedData_Tcpip_NetworkInterface -ComputerName tsvc2552101x001 -Filter 'Name="Broadcom NetXtreme Gigabit Ethernet"'
    $intbwbytes=$perfdata.currentbandwidth/8
    $currentbytespersec=$perfdata.BytesTotalPersec
    #if NIC util is over 75 then it closes program
    if(($currentbytespersec / $intbwbytes) -gt .75){
    $wshell.Popup("Network utilization over 75%, please try again later.",0,"Error",0x1) | Out-Null
    $formSoftwareInstaller.Close()
    return
    ¯\_(ツ)_/¯

  • Read xml from PHP file from Java

    Hello,
    I have a php file that returns xml data like :
    <?xml version="1.0" ?>
    - <reply>
    <message>Friend Request Send</message>
    <status>sucess</status>
    </reply>
    Using java (actually BlackBerry client) I need to get this data and based on status, dispaly the message. I don't want to use any SOAP. I am lost, with how to do and what to do to achieve the goal.
    I guess, I will have to use URL to sent and get the data. Am I correct or got to use something else which is better ??
    Can anyone help me how to do. Any help/guidance is highly appreciated. Any code line to achieve the same will be much better to understand and implement for me.
    Thanks

    Hi,
    Yes, I understand that socket programming can't and shouoldn't be done.
    In most of the cases, I will ahve to pass some data eg. for login - username & password, for register - all fields, etc. Then in that case, if i use URL, I will have to encode url like "http://...com/login?username=John&password=mathew", then open connection, then ????
    If I do url.openStream() straight away, i don't think its correct. I should be able to send data in some form and then get the resonse back.
    How can this be achieved?
    URL url = new URL("http://localhost/login.php");
    HttpURLConnection conn = new HttpURLConnection(url);
    conn.connect();
    conn.setRequestMethd("POST");
    Now how tdo I set parameters or set the url as http://localhost/login.php?username=John& password=mathew
    then how do i get the
    String msg = conn.getResponseMessage(); ' This may be normal msg or xml
    am I going this much correctly or doing something wrong. Then will also have to get the contents ou of xml - message, status, reply.
    Can you let me know about status till now and to move ahead.
    Thanks,

  • Cant add account manager from myverizon  keeps throwing error message

    did everything but go into the store. Im 9 months pregnant on bed rest and my verizon gives me an error when i try to add account manager. Called  922 0204  and customer service says its now verizon policy that you cant add anyone to your account until after 30 days   ive added and removed people before on the same day Talked to supervisor he said its a my verizon problem and that the ppl that are supposed to work on it arent in right now So shouldnt they have a way to bypass this??  what is up with this new rule?? Anyone else getting this same error??

       I originally had wireless service with Alltell and I was very concerned when Verizon purchased Alltell ( I had numerous bad experiences with Verizon customer service when I had their FIOS cable service).  For years now that Verizon took over for Alltell I have not had any issues and I believe it was because I did not have to contact customer service.   Now in December I purchased three new phones and my daugther wanted to change her work number to one of the numbers I had on my service.  You would have thought we were trying to pattern a new cure for cancer.  We had to spend hours on the phone with customer service trying to accoumplish a very easy task and each time my daugther tried to deal with these people they all complained because she was not an account manager. 
    For the last wo weeks I have tried to add my daughter thru the website.  Each time I got an error message stating that I needed to call 611 to get this corrected.   Tonight we called 611  and I got the same run around with customer service for the last 45 minutes, but they told me that I had to wait 60 days since we had purchased  new phones.   They also told me that we could go to a Verizon store location and this could be accomplished at the store.  I have already spent more time with customer service than any live person should and I certainly do not want to have to make another trip to a Verizon store.  It is utterly amazing how Verizon can take such simple tasks and turn them into a Federal case.  This waste hours of your time and also the time spent by their employees,  and you don't get anything accomplished.  They must be getting so many complaints that now there is no place on their website where you can write a complaint.         

Maybe you are looking for

  • Photos not showing up in MacOS Desktop

    I read in a response to a message about downloading photos the following: "However you can move photos as you have already seen by using the quick install tool." I don't undertand it what that stement meant.  Sooo my question is: Is there any way I c

  • Can a MacBook 2 Ghz core 2 duo be upgraded to Lion?

    Can the MacBook 2 Ghz Intel Core 2 Duo be upgraded to Snow Leopard andLion?

  • My iPod touch was synicing now it won`t. What happened?

    Hey, I got my iPod 2 weeks ago. It was syncing the friest 3 times. Now it`s not. What happened?

  • GRAPH in Query Generator Reports

    Hi Experts, I would like know what is the logic to generate graph in Query Generator report. you can see there is graph button in Query Generator window, if you click on this button, shows popup window with graph. i am not sure what is the logic they

  • Watermarks on photos in gallery

    Hi all, can someone please tell me how to put a watermark on my gallery of cards so when people copythem they wont have a photo that they can use? The gallery of cards was made in DW MX 2004 thanks, jeannie