[Xml-compile] XML::Compile fails with import url

Mark Overmeer mark at overmeer.net
Mon May 10 08:41:08 GMT 2010


* Tapio.Niva at tieto.com (Tapio.Niva at tieto.com) [100510 08:27]:
> sorry, the WSDL (subscribe.wsdl) is now attached,
> 
> -----Original Message-----
> > "error: cannot find element or attribute
> `{http://notification.sdk.nms.ov.hp.com/nms-sdk-notify}incidentNotification'

Bug in the schema, IMO.
The message says:

  <wsdl:message name="IncidentNotificationMsg">
    <wsdl:part element="tns:incidentNotification" name="body" />
  </wsdl:message>

So: *element* incidentNotification
But the schema only defines a *type*

  <xs:complexType name="incidentNotification">
    <xs:sequence>
      <xs:element minOccurs="0" name="category" type="xs:string" />
      <xs:element name="duplicateCount" type="xs:int" />

You could patch this by adding this to your code:

  my $notify_ns = 'http://notification.sdk.nms.ov.hp.com/nms-sdk-notify';

  $wsdl->importDefinition(<<_PATCH);
  <schema elementFormDefault="qualified"
     targetNamespace="$notify_ns"
     xmlns:tns="$notify_ns"
     xmlns="http://www.w3.org/2001/XMLSchema">
  <element name="incidentNotification" type="tns:incidentNotification"/>
  </schema>
  _PATCH

There are many schemas with bugs, usually caused by sloppy schema tools.
-- 
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