http://qs321.pair.com?node_id=649669


in reply to Re^5: SOAP::WSDL Installation
in thread SOAP::WSDL Installation

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?

Replies are listed 'Best First'.
Re^7: SOAP::WSDL Installation
by erroneousBollock (Curate) on Nov 08, 2007 at 10:05 UTC
    Could you post the generated WSDL file ?

    -David

      Here it is:
      <?xml version="1.0" encoding="utf-8" ?> - <wsdl:definitions name="ChangelistApprovalService" targetNamespace=" +http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xm +lns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://do +cs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0 +.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns +:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2 +004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/p +olicy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/p +olicy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http:/ +/schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://w +ww.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlso +ap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressin +g" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"> - <wsdl:types> - <xsd:schema elementFormDefault="qualified" targetNamespace="http://t +empuri.org/"> - <xsd:element name="SampleTest"> - <xsd:complexType> - <xsd:sequence> <xsd:element minOccurs="0" name="test" nillable="true" type="q1:Test +er" xmlns:q1="http://schemas.datacontract.org/2004/07/BugApproval.Per +force" /> </xsd:sequence> </xsd:complexType> </xsd:element> - <xsd:element name="SampleTestResponse"> - <xsd:complexType> - <xsd:sequence> <xsd:element minOccurs="0" name="SampleTestResult" nillable="true" t +ype="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> - <xsd:schema elementFormDefault="qualified" targetNamespace="http://s +chemas.datacontract.org/2004/07/BugApproval.Perforce" xmlns:tns="http +://schemas.datacontract.org/2004/07/BugApproval.Perforce"> - <xsd:complexType name="Tester"> - <xsd:sequence> <xsd:element name="Age" type="xsd:int" /> <xsd:element name="Name" nillable="true" type="xsd:string" /> </xsd:sequence> </xsd:complexType> <xsd:element name="Tester" nillable="true" type="tns:Tester" /> </xsd:schema> - <xs:schema attributeFormDefault="qualified" elementFormDefault="qual +ified" targetNamespace="http://schemas.microsoft.com/2003/10/Serializ +ation/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http:/ +/schemas.microsoft.com/2003/10/Serialization/"> <xs:element name="anyType" nillable="true" type="xs:anyType" /> <xs:element name="anyURI" nillable="true" type="xs:anyURI" /> <xs:element name="base64Binary" nillable="true" type="xs:base64Binar +y" /> <xs:element name="boolean" nillable="true" type="xs:boolean" /> <xs:element name="byte" nillable="true" type="xs:byte" /> <xs:element name="dateTime" nillable="true" type="xs:dateTime" /> <xs:element name="decimal" nillable="true" type="xs:decimal" /> <xs:element name="double" nillable="true" type="xs:double" /> <xs:element name="float" nillable="true" type="xs:float" /> <xs:element name="int" nillable="true" type="xs:int" /> <xs:element name="long" nillable="true" type="xs:long" /> <xs:element name="QName" nillable="true" type="xs:QName" /> <xs:element name="short" nillable="true" type="xs:short" /> <xs:element name="string" nillable="true" type="xs:string" /> <xs:element name="unsignedByte" nillable="true" type="xs:unsignedByt +e" /> <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt" + /> <xs:element name="unsignedLong" nillable="true" type="xs:unsignedLon +g" /> <xs:element name="unsignedShort" nillable="true" type="xs:unsignedSh +ort" /> <xs:element name="char" nillable="true" type="tns:char" /> - <xs:simpleType name="char"> <xs:restriction base="xs:int" /> </xs:simpleType> <xs:element name="duration" nillable="true" type="tns:duration" /> - <xs:simpleType name="duration"> - <xs:restriction base="xs:duration"> <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?" /> <xs:minInclusive value="-P10675199DT2H48M5.4775808S" /> <xs:maxInclusive value="P10675199DT2H48M5.4775807S" /> </xs:restriction> </xs:simpleType> <xs:element name="guid" nillable="true" type="tns:guid" /> - <xs:simpleType name="guid"> - <xs:restriction base="xs:string"> <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA +-F]{4}-[\da-fA-F]{12}" /> </xs:restriction> </xs:simpleType> <xs:attribute name="FactoryType" type="xs:QName" /> </xs:schema> </wsdl:types> - <wsdl:message name="IChangelistApprovalService_SampleTest_InputMessa +ge"> <wsdl:part name="parameters" element="tns:SampleTest" /> </wsdl:message> - <wsdl:message name="IChangelistApprovalService_SampleTest_OutputMess +age"> <wsdl:part name="parameters" element="tns:SampleTestResponse" /> </wsdl:message> - <wsdl:portType name="IChangelistApprovalService"> - <wsdl:operation name="SampleTest"> <wsdl:input wsaw:Action="http://tempuri.org/IChangelistApprovalServi +ce/SampleTest" message="tns:IChangelistApprovalService_SampleTest_Inp +utMessage" /> <wsdl:output wsaw:Action="http://tempuri.org/IChangelistApprovalServ +ice/SampleTestResponse" message="tns:IChangelistApprovalService_Sampl +eTest_OutputMessage" /> </wsdl:operation> </wsdl:portType> - <wsdl:binding name="BasicHttpBinding_IChangelistApprovalService" typ +e="tns:IChangelistApprovalService"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> - <wsdl:operation name="SampleTest"> <soap:operation soapAction="http://tempuri.org/IChangelistApprovalSe +rvice/SampleTest" style="document" /> - <wsdl:input> <soap:body use="literal" /> </wsdl:input> - <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> - <wsdl:service name="ChangelistApprovalService"> - <wsdl:port name="BasicHttpBinding_IChangelistApprovalService" bindin +g="tns:BasicHttpBinding_IChangelistApprovalService"> <soap:address location="http://localhost:5718/" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
        The "Tester" complexType looks very simple. I have much more complicated classes which work fine.

        SOAP::WSDL doesn't have any trouble producing compliant messages for that WSDL. The web-service must be rejecting messages that are valid for the WSDL you've pasted. It'd be very useful to get some idea of what the web-service (or WCF deserialiser) thinks is wrong with the message... alas I have no idea how to do that.

        Are you still getting warnings about unsupported schema/import features? (and you're on SOAP::WSDL 1.23 correct?)

        -David