[Xml-compile] wsdl naming issue.
Mark Overmeer
mark at overmeer.net
Thu May 30 22:22:40 GMT 2013
* Nicholas Ellis (nicholas.ellis at leadkarma.com) [130530 19:34]:
> I am having an issue with the wsdl:service name and wsdl:port name as they
> both start with numbers. Is there some way to get around the validation or
> patch the schema so this is acceptable. I got this document from a client
> and cant really change it.
>
> <wsdl:service name="123name">
> <wsdl:port name="123namePort"
I was not aware of it, but you are right: those names need to be
xsd:NCName.
A pity that the WSDL schema does not abstract that type, because
that would make it easy to overrule its interpretation. Now, we
need more difficult tricks.
You could overwrite XML::Compile::Schema::BuiltInTypes::_ncname()
Cleaner would be to patch the wsdl:
$wsdl->importDefinition( <<__PATCH )
<xs:schema ...>
<xs:complexType name="tService">
<xs:complexContent>
<xs:extension base="wsdl:tExtensibleDocumented">
<xs:sequence>
<xs:element name="port" type="wsdl:tPort" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
__PATCH
Or
$wsdl->importDefinition($patch_file)
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark at Overmeer.net solutions at overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
More information about the Xml-compile
mailing list