Ask a Question related to PERL Modules, Design and Development.
-
arthur #1
Failed to invoke SOAP::Lite object with two parameters
Hi all:
I tried to instantiate an object through soap::lite but failed when it
involves two attributes in other words more than one element in the
hash. Can anyone help me to figure what could have been the cause?
I have attached the client and server codes below.
Thank you!
Arthur
#!C:\Perl\bin\perl -w
use strict;
use SOAP::Lite;
--Client Side
my $soap = SOAP::Lite
-> uri('http://localhost:8080/Protein')
-> proxy('http://localhost:8080/cgi-bin/SeedServer.cgi');
#my $protein = $soap->newProtein_With_Name("Insulin")->result;
#print $soap->getName($protein)->result;
my $protein =
$soap->newProtein_With_ID_And_Name(1,"Insulin")->result;
print $soap->getName($protein)->result;
#The error message: Element 'protname' can't be allowed in valid XML
message. Died
--
--Server Side
#!C:\Perl\bin\perl -w
use strict;
use SOAP::Transport::HTTP;
my $protein = Protein->newProtein_With_ID_And_Name(1,"Insulin");
print $protein->getName;
print $protein->getID;
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI
-> dispatch_to('Protein')
-> handle;
package Protein;
sub newProtein_With_Name{
#my $class = shift;
my $self = shift;
my $class = ref($self) || $self;
#my $protid = shift;
my $protname = shift;
#my $self = bless {ID => $id, Name => $name}, $class;
my $ref = {protname => $protname};
print $protname;
bless $ref, $class; #returns an instance of $self-a reference to an
anonymous hash
return $ref; #optional
}
sub newProtein_With_ID_And_Name{
#my $class = shift;
my $self = shift;
my $class = ref($self) || $self;
my $protid = shift;
my $protname = shift;
my $ref = {protid => $protid, protname => $protname};
bless $ref, $class; #returns an instance of $self-a reference to an
anonymous hash
return $ref;
}
sub getName{
my $self = shift;
$self->{protname};
}
sub getID{
my $self = shift;
$self->{protid};
}
arthur Guest
-
Writing a HTML/ASP SOAP client for a SOAP::Lite destination
How would I go about writing a SOAP client in either HTML or classic asp? The SOAP "listener" was written in Perl with SOAP::Lite in Unix and I am... -
SOAP::Lite
Hi, I have been playing with SOAP::Lite for a while, and generally find that it is really very useful. So the other day I came across a problem... -
SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring
Hello, I have a problem with a SOAP client written in Perl (source at the end). I've tried both ways (by commenting TRIAL ONE or SECOND TRIAL),... -
Invoke methods dinamically with out parameters in c#
Hi, I'm trying to call a web service dinamically that has a method with out parameters. The way I'm calling the method is passing an object array... -
SOAP::Lite - serve a complex "object"?
Partial answer/hack to the question. 1) Manually change the generated proxy class for "outdata". (this is bad) Replace: public string...



Reply With Quote

