Skip Menu |
 

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

Report information
The Basics
Id: 62237
Status: resolved
Priority: 0/
Queue: XML-Compile-SOAP

People
Owner: Nobody in particular
Requestors: aleksey.mashanov [...] gmail.com
Cc:
AdminCc:

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



Subject: enumeration of xs:QName
In SOAP 1.2 fault code is defined as: <xs:simpleType name="faultcodeEnum"> <xs:restriction base="xs:QName"> <xs:enumeration value="tns:DataEncodingUnknown"/> <xs:enumeration value="tns:MustUnderstand"/> <xs:enumeration value="tns:Receiver"/> <xs:enumeration value="tns:Sender"/> <xs:enumeration value="tns:VersionMismatch"/> </xs:restriction> </xs:simpleType> I trying to parse SOAP 1.2 fault response: <s:Envelope xml:lang="ru-RU" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd"><s:Header><a:Action>http://schemas.dmtf.org/wbem/wsman/1/wsman/fault</a:Action><a:MessageID>uuid:388AABBA-7069-4FE0-BECF-392172479BF0</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:24E0E618-DAC7-11DF-B23F-876D98000C21</a:RelatesTo></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Receiver</s:Value><s:Subcode><s:Value>w:InternalError</s:Value></s:Subcode></s:Code><s:Reason><s:Text xml:lang=""></s:Text></s:Reason><s:Detail><f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2152992672" Machine="xxx.xxx.xxx.xxx"><f:Message><f:ProviderFault provider="PowerShellplugin" path="%windir%\system32\pwrshplugin.dll">Remoting data is missing HostInfo property. </f:ProviderFault></f:Message></f:WSManFault></s:Detail></s:Fault></s:Body></s:Envelope> The reported error is: error: invalid enumerate `{http://www.w3.org/2003/05/soap-envelope}Receiver' at {http://www.w3.org/2003/05/soap-envelope}Fault/Code/Value#facet XML::Compile::Schema::BuiltInFacets::_enumeration() compares QName in form '{ns}name' (value received as 's:Receiver' from server and translated to '{http://www.w3.org/2003/05/soap-envelope}Receiver') with simplified form 'tns:name' of possible values from schema.
Subject: Re: [rt.cpan.org #62237] enumeration of xs:QName
Date: Tue, 19 Oct 2010 11:30:23 +0200
To: Aleksey Mashanov via RT <bug-XML-Compile-SOAP [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
Download (untitled) / with headers
text/plain 1.9k
* Aleksey Mashanov via RT (bug-XML-Compile-SOAP@rt.cpan.org) [101018 17:43]: Show quoted text
> Mon Oct 18 11:43:30 2010: Request 62237 was acted upon. > Transaction: Ticket created by amashanov > Queue: XML-Compile-SOAP > Subject: enumeration of xs:QName > Requestors: aleksey.mashanov@gmail.com > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=62237 > > > In SOAP 1.2 fault code is defined as: > > <xs:simpleType name="faultcodeEnum"> > <xs:restriction base="xs:QName"> > <xs:enumeration value="tns:DataEncodingUnknown"/> > <xs:enumeration value="tns:MustUnderstand"/> > <xs:enumeration value="tns:Receiver"/> > <xs:enumeration value="tns:Sender"/> > <xs:enumeration value="tns:VersionMismatch"/> > </xs:restriction> > </xs:simpleType>
I was not aware of this possibility. In the current implementation, the check of facets does not know about the type which is being checked. This has to be rewritten to fix this. The rewrite is also needed to fix the length restrictions on base64Binary and hexBinary... It's a lot of work for rarely used constructs. Still needed. A simple work-around would be to simply disable the restriction at parse time, either by overwriting the definition $schema->importDefinitions( <<'_SCHEMA' ) <xs:schema [add declarations]> <xs:simpleType name="faultcodeEnum"> <xs:restriction base="xs:QName" /> </xs:simpleType> </xs:schema> _SCHEMA Or hook the faultcodeEnum type. You are trying to implement SOAP1.2 based in XML::Compile. I am very interested in the code, where I still have to implement XML::Compile::SOAP12 myself ;-) -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Download (untitled) / with headers
text/plain 827b
Thanks for your answer. I used your hack and it works. $schemas->importDefinitions( <<_DIRTY_TRICK ); <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2003/05/soap-envelope" elementFormDefault="qualified"> <xs:simpleType name="faultcodeEnum"> <xs:restriction base="xs:QName"> <xs:enumeration value="{http://www.w3.org/2003/05/soap-envelope}DataEncodingUnknown"/> <xs:enumeration value="{http://www.w3.org/2003/05/soap-envelope}MustUnderstand"/> <xs:enumeration value="{http://www.w3.org/2003/05/soap-envelope}Receiver"/> <xs:enumeration value="{http://www.w3.org/2003/05/soap-envelope}Sender"/> <xs:enumeration value="{http://www.w3.org/2003/05/soap-envelope}VersionMismatch"/> </xs:restriction> </xs:simpleType> </xs:schema> _DIRTY_TRICK
fixed in 1.19, just released to CPAN.


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.