Skip Menu |
 

This queue is for tickets about the SOAP-WSDL CPAN distribution.

Report information
The Basics
Id: 34688
Status: resolved
Priority: 0/
Queue: SOAP-WSDL

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: wsdl2perl.pl croaks when WSDL operation uses a header
Download (untitled) / with headers
text/plain 763b
I found this bug in version 2.00_33, which unfortunately is not available in the version list of the bug tracker. Attached is the WSDL of a simple "Hello World" style service, but utilizing a SOAP header. I run "wsdl2perl.pl file:///path/to/test.wsdl" and get this error: Creating typemap class MyTypemaps/TestService.pm Creating interface class MyInterfaces/TestService/TestPort.pm /usr/lib/perl5/vendor_perl/5.8.8/SOAP/WSDL/Generator/Template/XSD\Interface.tt undef error - Can't call method "get_element" on an undefined value at (eval 715) line 21. at /usr/bin/wsdl2perl.pl line 123 wsdl2perl.pl works as soon as I remove the "<soap:header ..." line. Severity "Important" because many real world webservices use headers for authentication purposes.
Subject: test.wsdl
Download test.wsdl
text/plain 1.9k
<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="urn:TestNamespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:TestNamespace" targetNamespace="urn:TestNamespace"> <wsdl:types> <xsd:schema targetNamespace="urn:TestNamespace" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xsd:element name="helloWorldHeader" type="xsd:string"/> <xsd:element name="helloWorldRequest" type="xsd:string"/> <xsd:element name="helloWorldResponse" type="xsd:string"/> </xsd:schema> </wsdl:types> <wsdl:message name="helloWorldHeader"> <wsdl:part name="helloWorldHeader" element="tns:helloWorldHeader"/> </wsdl:message> <wsdl:message name="helloWorldRequest"> <wsdl:part name="helloWorldRequest" element="tns:helloWorldRequest"/> </wsdl:message> <wsdl:message name="helloWorldResponse"> <wsdl:part name="helloWorldResponse" element="tns:helloWorldResponse"/> </wsdl:message> <wsdl:portType name="TestInterface"> <wsdl:operation name="helloWorld"> <wsdl:input message="tns:helloWorldRequest"/> <wsdl:output message="tns:helloWorldResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="TestBinding" type="tns:TestInterface"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="helloWorld"> <soap:operation soapAction=""/> <wsdl:input> <soap:header use="literal" message="tns:helloWorldHeader" part="helloWorldHeader"/> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="TestService"> <wsdl:port binding="tns:TestBinding" name="TestPort"> <soap:address location="http://www.example.com/"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
Subject: Re: [rt.cpan.org #34688] wsdl2perl.pl croaks when WSDL operation uses a header
Date: Sat, 05 Apr 2008 11:31:33 +0200
To: bug-SOAP-WSDL [...] rt.cpan.org
From: Martin Kutter <martin.kutter [...] fen-net.de>
Download (untitled) / with headers
text/plain 435b
actually, the WSDL is incorrect: The line specifying the header in the SOAP binding must read <soap:header use="literal" message="tns:helloWorldHeader" part="tns:helloWorldHeader"/> - the namespace prefix is missing for the part attribute's vaule. Nevertheless, SOAP::WSDL should complain about not being able to find part "helloWorldHeader" instead of printing some incomprehendible error message. Thanks for reporting, Martin
Download (untitled) / with headers
text/plain 344b
Thank you for your quick reply. Unfortunately I don't have a WSDL validator at hand so I could double check, but according to the WSDL spec (http://www.w3.org/TR/wsdl#_soap:header) the "part" attribute should be of type "nmtoken" and not of type "QName" like the "message" attribute, so I think it is correct that it is not namespace qualified.
Subject: Re: [rt.cpan.org #34688] wsdl2perl.pl croaks when WSDL operation uses a header
Date: Sat, 05 Apr 2008 17:24:52 +0200
To: bug-SOAP-WSDL [...] rt.cpan.org
From: Martin Kutter <martin.kutter [...] fen-net.de>
Download (untitled) / with headers
text/plain 602b
%RT RESOLVE 34688 Fixed in SVN. Thanks for reporting, Martin Am Samstag, den 05.04.2008, 09:14 -0400 schrieb http://www.jkg.in/openid/ds8tbj1k via RT: Show quoted text
> Queue: SOAP-WSDL > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=34688 > > > Thank you for your quick reply. Unfortunately I don't have a WSDL > validator at hand so I could double check, but according to the WSDL > spec (http://www.w3.org/TR/wsdl#_soap:header) the "part" attribute > should be of type "nmtoken" and not of type "QName" like the "message" > attribute, so I think it is correct that it is not namespace qualified. >
Subject: Re: [rt.cpan.org #34688] wsdl2perl.pl croaks when WSDL operation uses a header
Date: Sat, 05 Apr 2008 16:52:08 +0200
To: bug-SOAP-WSDL [...] rt.cpan.org
From: Martin Kutter <martin.kutter [...] fen-net.de>
Download (untitled) / with headers
text/plain 872b
Looks like you're right and I'm wrong - the example from the WSDL specs says: <binding name="StockQuoteSoap" type="tns:StockQuotePortType"> <soap:binding style="document" transport="http://example.com/smtp"/> <operation name="SubscribeToQuotes"> <input message="tns:SubscribeToQuotes"> <soap:body parts="body" use="literal"/> <soap:header message="tns:SubscribeToQuotes" part="subscribeheader" use="literal"/> </input> </operation> </binding> The part attribute is clearly non-qualified. Thus, SOAP::WSDL should use probably use the definition element's namespace for resolving the binding - clearly a weakness of the WSDL1.1 note, which says nothing about this. And of course not clarified in WSDL2.0 which has a completely different data model :-( Thanks for looking it up, Martin


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.