Click here to get back home

Failed to invoke SOAP::Lite object with two parameters

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Failed to invoke SOAP::Lite object with two parameters arthur 06-21-2005
Posted by arthur on June 21, 2005, 2:59 pm
Please log in for more thread options


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->;
}

sub getID{
my $self = shift;
$self->;
}



Similar ThreadsPosted
SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring November 5, 2004, 8:45 pm
SOAP::Lite WSDL method with multiple soap:body parts February 16, 2005, 3:32 pm
Writing a HTML/ASP SOAP client for a SOAP::Lite destination March 16, 2005, 5:19 pm
Help with SOAP::Lite January 19, 2005, 11:35 pm
SOAP::Lite March 3, 2005, 6:13 am
Using SOAP::Lite and .NET November 16, 2005, 2:12 pm
SOAP::Lite March 5, 2007, 4:26 am
use SOAP::Lite +autodispatch ??? November 23, 2004, 3:12 am
SOAP::Lite weirdness April 6, 2006, 8:07 am
ForkOnAccept for SOAP::Lite TCP server November 27, 2004, 11:32 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap