Skip Menu |
 

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

Report information
The Basics
Id: 61949
Status: new
Priority: 0/
Queue: SOAP-WSDL

People
Owner: Nobody in particular
Requestors: andrew [...] pullingshots.ca
Cc:
AdminCc:

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



Subject: child elements duplicated and inherit name from parent through options hash ref
Download (untitled) / with headers
text/plain 1.7k
I have SOAP::WSDL checked out from svn - https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/branches/Typemap/ - and am using the wsdl2perl.pl script against the UPS web services Rating API. in RateWebServiceSchema.xsd: <xsd:element name="RateRequest"> <xsd:complexType> <xsd:sequence> <xsd:element ref="common:Request"/> <xsd:element minOccurs="0" name="PickupType" type="rate:CodeDescriptionType"/> <xsd:element minOccurs="0" name="CustomerClassification" type="rate:CodeDescriptionType"/> <xsd:element name="Shipment" type="rate:ShipmentType"/> </xsd:sequence> </xsd:complexType> </xsd:element> and in common.xsd: <xsd:element name="Request" type="common:RequestType"/> ... <xsd:complexType name="RequestType"> <xsd:sequence> <xsd:element name="RequestOption" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="TransactionReference" type="common:TransactionReferenceType" minOccurs="0"/> </xsd:sequence> </xsd:complexType> with the following perl data structure { Request => { RequestOption => 'Shop', }, } results in the following xml: <Request xmlns="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0"> <Request> <Request>Shop</Request> </Request> </Request> the expected xml is as follows: <Request xmlns="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0"> <RequestOption>Shop</RequestOption> </Request> If I add the following at line 388 of SOAP/WSDL/XSD/Typelib/ComplexType.pm, the issue is resolved: if ($name && $option_ref->{name}) { delete $option_ref->{name}; } It seems as thought $option_ref->{name} is overwriting $name in this specific case which is what is causing the incorrect xml to be generated.


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.