It's all about the answers!

Ask a question

Perl - how do I close a connection to Jazz?


Cliff Gardiner (921234) | asked Mar 15 '17, 4:24 a.m.

I'm using Perl 5.22 and CLM 4.0.7 running under WAS 8.8.5.9.

I have a long-running Perl program interrogating RM project areas via OSLC.  My problem is that after 8 hours an attempt to retrieve an XML doc via a GET to a URL returns an HTML structure instead, which looks rather like a logon prompt as it includes this: 

    <script type="text/javascript">
    / <![CDATA[ /
        dojo.addOnLoad( function() {
            net.jazz.ajax.ui.PlatformUI.createAndRunWorkbench("net.jazz.web.app.authrequired");
        });
    / ]]> /
    </script>

Interestingly, the structure is not valid XML but that's not really the issue.

I've tried to periodically refresh the login session by this method:
$userAgent->conn_cache(LWP::ConnCache->new());
but the job still fails after 8 hours so clearly that doesn't work.  Simply periodically reissuing the intial logon ($$response = $$userAgent->request(POST $jazzConnUri,[j_username=>$jazzuser, j_password=>$jazzpwd]);) doesn't work either, and in fact fails.

I think the answer is to periodically close then reopen the connection, but I can't work out what I need to post to make the close happen.  Can anyone help?  Or offer a better strategy?

Be the first one to answer this question!


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.