Tolgar
asked on
Can't call method "saveGeck" on unblessed reference at talk2serive.pl line 16
Why do I get the this error when I run my script with the following command:
Can't call method "saveGeck" on unblessed reference at talk2serive.pl line 16
This is my code:
When I change line 16 with this one:
Now I get this error:
Undefined subroutine &main::saveGeck called at talk2service.pl line 16.
AND, this is how $ssc looks like:
perl talk2service.pl 333333 '>>now submitting these files'
Can't call method "saveGeck" on unblessed reference at talk2serive.pl line 16
This is my code:
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
# declare usage of SOAP::Lite
use SOAP::Lite;
my $submittedFiles = pop @ARGV;
foreach my $geckID (@ARGV) {
my $ssc = SOAP::Lite
-> service('SOME_DOMAIN/main/services/MyWebService?wsdl')
-> getGeck($geckID, 'tolgar');
print Dumper $ssc;
$ssc->{'solution'} .= $submittedFiles;
$ssc->saveGeck($geckID, 'tolgar');
}
When I change line 16 with this one:
saveGeck($geckID, 'tolgar');
Now I get this error:
Undefined subroutine &main::saveGeck called at talk2service.pl line 16.
AND, this is how $ssc looks like:
$VAR1 = {
'geckId' => '333333',
'solution' => 'SOME TEXT',
'geckStates' => [
bless( {
'status' => 'Completed',
'codedOn' => undef
}, 'GeckState' )
]
};
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Now it does not return any error but it also does not put anything in the solution field. However, I wanted to append the new text into this fileld.
This is how I call this file:
I expected .= to append but it basically does nothing.
Do you have any idea?
Thanks,
#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
use SOAP::Lite;
my $myFiles = pop @ARGV;
foreach my $geckID (@ARGV) {
my $ssc = SOAP::Lite
-> service('SOME_DOAMIN/main/services/MyWebService?wsdl');
my $geck = $ssc-> getGeck($geckID, 'tolgar');
$geck->{'solution'} .= $myFiles;
$ssc-> saveGeck($geck, 'tolgar');
}
This is how I call this file:
perl talk2service.pl 333333 '>>>>now appending'
I expected .= to append but it basically does nothing.
Do you have any idea?
Thanks,
At this point, I think the issue is with you specific web service. saveGeck should have some way of passing the structure back that you want to save (or else there is another function in your web service for doing the update and saveGeck just commits the save permanently).
Do you have documentation and examples for your web service that you can look through and figure out how to do the updating?
Do you have documentation and examples for your web service that you can look through and figure out how to do the updating?
ASKER
You are right. I am investigating it.
Thanks for your help,
Thanks for your help,
ASKER
if I change line 16 with this one:
Open in new window
Then I get this error:
syntax error at talk2service.pl line 16, near "-> saveGeck"
Execution of talk2service.pl aborted due to compilation errors.