Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^6: SOAP::WSDL Installation

by Khurrum (Novice)
on Nov 08, 2007 at 08:46 UTC ( #649669=note: print w/replies, xml ) Need Help??

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 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 3519 Reference found where even-sized list expected at C:/Perl/site/lib/SOA +P/ 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 ?


      Here it is:
      <?xml version="1.0" encoding="utf-8" ?> - <wsdl:definitions name="ChangelistApprovalService" targetNamespace=" +" xmlns:wsdl="" xm +lns:soap="" xmlns:wsu="http://do +.xsd" xmlns:soapenc="" xmlns +:tns="" xmlns:wsa=" +004/08/addressing" xmlns:wsp=" +olicy" xmlns:wsap=" +olicy" xmlns:xsd="" xmlns:msc="http:/ +/" xmlns:wsaw="http://w" xmlns:soap12="http://schemas.xmlso" xmlns:wsa10=" +g" xmlns:wsx=""> - <wsdl:types> - <xsd:schema elementFormDefault="qualified" targetNamespace="http://t"> - <xsd:element name="SampleTest"> - <xsd:complexType> - <xsd:sequence> <xsd:element minOccurs="0" name="test" nillable="true" type="q1:Test +er" xmlns:q1=" +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" xmlns:tns="http +://"> - <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=" +ation/" xmlns:xs="" xmlns:tns="http:/ +/"> <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=" +ce/SampleTest" message="tns:IChangelistApprovalService_SampleTest_Inp +utMessage" /> <wsdl:output wsaw:Action=" +ice/SampleTestResponse" message="tns:IChangelistApprovalService_Sampl +eTest_OutputMessage" /> </wsdl:operation> </wsdl:portType> - <wsdl:binding name="BasicHttpBinding_IChangelistApprovalService" typ +e="tns:IChangelistApprovalService"> <soap:binding transport="" /> - <wsdl:operation name="SampleTest"> <soap:operation soapAction=" +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?)


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://649669]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2022-07-04 12:04 GMT
Find Nodes?
    Voting Booth?

    No recent polls found