I've been using SOAP::Lite, with very good results so far, to emulate some terminals that use SOAP to connect to a server.
I now need to add in heartbeat functionality.
I've found a problem with the server not always responding to heartbeats. I've raised this with the devs, but as the terminal I'm simulating copes with this, I need to be able to cope too. Thing is, SOAP Lite's "call" blocks for (or at least that's how I'm reading it) a response and the occasions when I get no response cause me to crash. Message gen code:
my $heartbeat = SOAP::Lite->new(proxy => $proxy); $heartbeat->default_ns('lws:Heartbeat'); $heartbeat->autotype(0); $heartbeat->transport->timeout(1); $self->heartbeat($heartbeat); my $state = 1; my (@hbArgs) = ( SOAP::Data->name( 'deviceName' => $self->{id} ), SOAP::Data->name( 'username' => $self->{userName} ), SOAP::Data->name( 'sessionId' => $self->sessInfo->{sessionI +d} ), SOAP::Data->name( 'state' => $state ), SOAP::Data->name( 'taskId' => $self->{taskId} ), SOAP::Data->name( 'location' => ''), ); my (@obj) = SOAP::Data->name( 'obj' => \SOAP::Data->value( @hbArgs, ), ); my (@message) = SOAP::Data->name( 'message' => \SOAP::Data->value( @obj, ), ); print "Let's try\n"; $self->call( "heartbeat", "sendPulse", \@message); print "WE're back!!\n";
and my call:
sub call { my ($self, $handle, $cmd, $params) = @_; if($cmd eq "sendPulse") { # Don't need to do anything with the heartbeat response $self->TOOLS::Print::sending("Sending heartbeat"); $self->{$handle}->call( $cmd, @{$params} ); return $self->{call}; } $self->callResp($self->{$handle}->call( $cmd, @{$params} )); if($cmd ne "login")
Output:

SENDING HEARTBEAT
$proxy = 'http://128.0.100.135:14901';
Let's try
500 read timeout at /usr/users/stevew/Testing/Director/perl5/../lib/HHT.pm line 278
Line 278 being (from above):

$self->{$handle}->call( $cmd, @{$params} );
Is there a way to send a SOAP message using SOAP::Lite and not expect a response?

In reply to Handle sending SOAP::Lite call which may not get a response by walshy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.