Thank you for your detailed response. I was able to get SOAP::Lite 0.69 installed properly whereas i am running SOAP::WSDL 1.23 because there wasnt any connectivity issue with trouchelle.com it still gives me the same error as before.
I read through the resource links you provided and they were quite helpful and i was able to get my earlier error fixed so at least now i can call a simple method exposed through my service with only one string argument. This verifies that my WSDL is correctly generated.
Now when i run the test script you gave me earlier where i try to pass a Tester object that doesnt seem to work properly. I get the following output:
C:\SoapTest>perl perlMonk.pl 3519
Reference found where even-sized list expected at C:/Perl/site/lib/SOA
+P/WSDL.pm
line 235.
$VAR1 = 'NULL test';
Now here the script i use:
use SOAP::WSDL;
use Data::Dumper;
use strict;
my $proxy = "http://localhost:" . $ARGV[0] . "/";
my $soap = SOAP::WSDL->new();
$soap->wsdl('http://localhost:8000/');
$soap->proxy($proxy);
#$soap->on_action(sub { return $_[0].$_[1]; }); $soap->wsdlinit
+(caching => 1);
my $som = $soap->SampleTest({ Name => 'Nathan', Age => 22});
if ($som->fault)
{
print "SampleTest Error: ".$som->faultstring."\n";
}
else
{
print Dumper($som->paramsall);
}
My implemtation for the method is:
public string SampleTest(Tester test)
{
if (test == null)
{
return String.Format("NULL test");
}
else if (test.Age == 22)
{
return String.Format("SUCCESS test");
}
else
{
return String.Format("FAILURE test");
}
}
And the Tester class implementation is:
[DataContract]
public class Tester
{
private string name;
private int age;
public Tester(string n, int a)
{
name = n;
age = a;
}
[DataMember(IsRequired = true)]
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
[DataMember(IsRequired = true)]
public int Age
{
get
{
return age;
}
set
{
age = value;
}
}
}
I can see two things going wrong either the SOAP::WSDL doesnt send the object properly or SOAP::WSDL cant handle some of the WCF generated WSDL contructs more specifically relating to the Tester class implementation because i was able to get SOAP::WSDL to work with the following simple web service method:
public string HelloWorld(string name)
{
return String.Format("Hello {0}!!!", name);
}
I will continue playing around but do you have any suggestions? |