Loading ...
Sorry, an error occurred while loading the content.

Server don't return.

Expand Messages
  • levtartakovsky
    Hello All, I m novice to SODA. I m trying to implement persistent server for IBM Rational ClearQuest based on XMLRPC::Lite. For binary compatibility reasons
    Message 1 of 1 , Oct 7, 2003
    • 0 Attachment
      Hello All,

      I'm novice to SODA. I'm trying to implement persistent server for IBM
      Rational ClearQuest based on XMLRPC::Lite.
      For "binary compatibility reasons" IBM Rational urges use of
      ratlperl
      (special Perl distribution based on ActiveState Perl v5.6.1 build
      629) for using CQPerlExt Perl module, which provides a ClearQuest API.

      Following is my sever code:
      use lib "/opt/rational/clearquest/sun5/shlib";
      use CQPerlExt;
      use XMLRPC::Transport::HTTP;

      our $session = CQPerlExt::CQSession_Build();
      $session->UserLogon("user","password","CQDB","");

      my $daemon = XMLRPC::Transport::HTTP::Daemon
      -> new (LocalPort => 8081)
      -> dispatch_to('CQ')
      ;
      print "Contact to XMLRPC server at ", $daemon->url, "\n";
      $daemon->handle;

      package CQ;

      sub LsProject {shift if UNIVERSAL::isa($_[0] => __PACKAGE__);
      my $queryDef = $session->BuildQuery("Project");
      $queryDef->BuildField("Name");

      my $operator=$queryDef->BuildFilterOperator
      ($CQPerlExt::CQ_BOOL_OP_AND);
      my $resultSet = $session->BuildResultSet($queryDef);

      $resultSet->Execute;
      my @Projects = ();
      push @Projects, $resultSet->GetColumnValue(1) while ($resultSet-
      >MoveNext == $CQPerlExt::CQ_SUCCESS);

      print join(", ", @Projects), "\n";

      return [@Projects];
      }


      Client code:
      #!C:/perl/bin/perl
      # Have a chart made for us

      use XMLRPC::Lite;

      my $conn = XMLRPC::Lite
      -> proxy('http://server:8081/');

      print @{$conn->
      on_debug(sub{print @_})->
      call(CQ.LsProject')
      -> result}, "\n";
      ;

      POST http://trentino:8081/
      Accept: text/xml
      Accept: multipart/*
      Content-Length: 117
      Content-Type: text/xml

      <?xml version="1.0" encoding="UTF-8"?
      ><methodCall><methodName>CQ.LsProject</methodName><params/></methodCal
      l>
      HTTP/1.1 200 OK
      Date: Tue, 07 Oct 2003 15:53:30 GMT
      Server: libwww-perl-daemon/1.24
      Content-Length: 562
      Content-Type: text/xml
      Client-Date: Tue, 07 Oct 2003 15:53:30 GMT
      Client-Peer: 137.167.6.80:8081
      SOAPServer: SOAP::Lite/Perl/0.55

      <?xml version="1.0" encoding="UTF-8"?
      ><methodResponse><fault><value><struct><member><name>faultString</name
      ><value><string> (in cleanup) Not a HASH reference
      at /opt/rational/clearquest/sun5/shlib/CQPerlExt.pm line 3174.
      (in cleanup) Not a HASH reference
      at /opt/rational/clearquest/sun5/shlib/CQPerlExt.pm line 3512.
      (in cleanup) Not a HASH reference
      at /opt/rational/clearquest/sun5/shlib/CQPerlExt.pm line 4564.
      </string></value></member><member><name>faultCode</name><value><string
      >Server</string></value></member></struct></value></fault></methodResp
      onse>

      As you can see the server returns nothing.

      But as you can see on the line before return I print the list of the
      Project. And as expected, the list of the projects it printed on the
      server side. But it is lost somewhere on the way back to the client.

      I'm wondering why XMLRPC::Lite loses output returned by the server.

      The failure is reported each time in the same function:

      sub DESTROY {
      my $self = tied(%{$_[0]}); # This line is reported as failed
      delete $ITERATORS{$self};
      if (exists $OWNER{$self}) {
      CQPerlExtc::delete_CQResultSet($self);
      delete $OWNER{$self};
      }
      }

      If I change the server and enter the stub which return the dummy
      array prior the CQ API call everything works fine.
      My stub looks like following:

      sub LsProject {shift if UNIVERSAL::isa($_[0] => __PACKAGE__);
      my @Dummy = ("a", "b", "c");
      # This would work
      return [@Dummy ];
      my $queryDef = $session->BuildQuery("Project");
      This would not work
      # return [@Dummy ];
      $queryDef->BuildField("Name");

      my $operator=$queryDef->BuildFilterOperator
      ($CQPerlExt::CQ_BOOL_OP_AND);
      my $resultSet = $session->BuildResultSet($queryDef);

      $resultSet->Execute;
      my @Projects = ();
      push @Projects, $resultSet->GetColumnValue(1) while ($resultSet-
      >MoveNext == $CQPerlExt::CQ_SUCCESS);

      print join(", ", @Projects), "\n";

      return [@Projects];
      }
      Please note it the stup (return [@Dummy ];) is entered after the CQ
      API call, it would'n return.
      It looks like some kind of the memory management problem.
    Your message has been successfully submitted and would be delivered to recipients shortly.