Topic
3 replies Latest Post - ‏2012-07-30T09:31:53Z by SooTeong
SooTeong
SooTeong
6 Posts
ACCEPTED ANSWER

Pinned topic Failed to Load XML Data

‏2010-06-02T08:05:23Z |
I am writing a script that reads CR data from an excel file and submits into Change via the csapi.

Part of the code as below (all perl modules and initialisations are done):

$csapi->setUpConnection(
"http", $CMSHost, $CMSPort); $aUser = $csapi->Login($CMSUser, $CMSPassword, 
"User", $CMSDB); 

for ($row;$row<$row_max;$row++) 
{ $submitter                        = $worksheet->get_cell($row,0)->value(); $submitter_name                  = $worksheet->get_cell($row,1)->value(); $submitter_email         = $worksheet->get_cell($row,2)->value(); $request_type                    = $worksheet->get_cell($row,3)->value(); $severity                        = $worksheet->get_cell($row,4)->value(); $priority                        = $worksheet->get_cell($row,5)->value(); $product_name                    = $worksheet->get_cell($row,6)->value(); $product_subsys                  = $worksheet->get_cell($row,7)->value(); $discovered_on                   = $worksheet->get_cell($row,8)->value(); $discovered_during               = $worksheet->get_cell($row,9)->value(); $problem_synopsis                = $worksheet->get_cell($row,10)->value(); $problem_description            = $worksheet->get_cell($row,11)->value();   $tmp = $csapi->SubmitCRData( $aUser, 
"START_HERE2submitted" );   $tmp->getDataObjectByName(
"submitter")->setValue($submitter); $tmp->getDataObjectByName(
"submitter_name")->setValue($submitter_name); $tmp->getDataObjectByName(
"submitter_email")->setValue($submitter_email); $tmp->getDataObjectByName(
"request_type")->setValue($request_type); $tmp->getDataObjectByName(
"severity")->setValue($severity); $tmp->getDataObjectByName(
"priority")->setValue($priority); $tmp->getDataObjectByName(
"product_name")->setValue($product_name); $tmp->getDataObjectByName(
"product_subsys")->setValue($product_subsys); $tmp->getDataObjectByName(
"discovered_on")->setValue($discovered_on); $tmp->getDataObjectByName(
"discovered_during")->setValue($discovered_during); $tmp->getDataObjectByName(
"problem_synopsis")->setValue($problem_synopsis); $tmp->getDataObjectByName(
"problem_description")->setValue($problem_description); $tmp->getDataObjectByName(
"crstatus")->setValue($tmp->getTransitionLink(0)->getToState());   $tmpstr = $csapi->SubmitCR($aUser, $tmp); 
}


This piece of code will execute for 10 iterations, then it throws an error.

The fault code: 1
The fault string: Failed to Load XML Data

Anyone faced this? Usually this is caused by bad queries or replies to and from server, but why does it succeed for 10 entries, then fail?
Updated on 2012-07-30T09:31:53Z at 2012-07-30T09:31:53Z by SooTeong
  • SooTeong
    SooTeong
    6 Posts
    ACCEPTED ANSWER

    Re: Failed to Load XML Data

    ‏2010-06-04T14:31:02Z  in response to SooTeong
    Found the cause, but it's a bit weird.

    The machines that faced this problem were using perl 5.8.8. Machines with 5.10.1 did not face this problem.

    Upgrading those with 5.8.8 to 5.10.1 solved this.
  • SystemAdmin
    SystemAdmin
    111 Posts
    ACCEPTED ANSWER

    Re: Failed to Load XML Data

    ‏2012-07-12T22:19:38Z  in response to SooTeong
    which perl modules are you using here?
    • SooTeong
      SooTeong
      6 Posts
      ACCEPTED ANSWER

      Re: Failed to Load XML Data

      ‏2012-07-30T09:31:53Z  in response to SystemAdmin
      hi devenbabu,

      at that point in time, i was using a few modules.

      #general script execution and logging
      use Getopt::Long;
      use POSIX qw(strftime);
      use Time::Local;

      #for excel manipulation
      use Spreadsheet::ParseExcel;

      #for Synergy 6.3 and Change 4.3
      use ChangeSynergy::csapi;
      use VCS::CMSynergy;

      #net services
      use NET::FTP;
      use NET::SMTP;
      use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);

      #text services
      use Text::Unidecode;
      use utf8;