[Xml-compile] XML::Compile fails on rpc operation : namespace required

Tapio.Niva at tieto.com Tapio.Niva at tieto.com
Mon Aug 23 11:28:26 GMT 2010


Hello,
(obviously my previous emails on this subject were not on right format, I hope this 3rd trial will succeed...)

trying to compile a vendor's subscribe.wsdl with XML::Compile  gives following error for which I did not find a reason :

RESULT :
... < begin of trace deleted because of email size restrictions >
trace: parsing XML from string SCALAR(0x5cb1e30)
IMPORTED PATCH
trace: cache parsed file ws_eventing.wsdl-1282131474-4676
trace: parsing XML from file ws_eventing.wsdl
IMPORTED : ws_eventing.wsdl
trace: cache parsed file ws-eventing.xsd-1282131843-6060
trace: parsing XML from file ws-eventing.xsd
IMPORTED : ws-eventing.xsd
trace: cache parsed file ws-addr.xsd-1282131975-5146
trace: parsing XML from file ws-addr.xsd
IMPORTED : ws-addr.xsd
error: rpc operation {http://notification.sdk.nms.ov.hp.com/nms-sdk-notify}IncidentNotificationMsg requires namespace attribute
 at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP11/Operation.pm line 107
XML::Compile::SOAP11::Operation::_msg_parts("XML::Compile::SOAP11::Operation", XML::Compile::WSDL11=HASH(0x66cbdd0), "IncidentNotificationResponse", "rpc", HASH(0x6873cf0), HASH(0x68918c0)) at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP11/Operation.pm line 84
XML::Compile::SOAP11::Operation::_fromWSDL11("XML::Compile::SOAP11::Operation", "name", "IncidentNotification", "kind", "notification-operation", "service", HASH(0x6957220), "serv_port", [13 more]) at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/WSDL11.pm line 300
XML::Compile::WSDL11::operation(XML::Compile::WSDL11=HASH(0x66cbdd0), "operation", "IncidentNotification", "server", "uc:pw at nnm_server") at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/WSDL11.pm line 322
XML::Compile::WSDL11::compileClient(XML::Compile::WSDL11=HASH(0x66cbdd0), "operation", "IncidentNotification", "server", "uc:pw at nnm_server") at ./test_XML_compile.pl line 37
#

USED SCRIPT :
#!/usr/bin/perl
use strict;
use warnings;
use XML::Compile::WSDL11;
use XML::Compile::SOAP11;
use XML::Compile::Transport::SOAPHTTP;
use XML::Compile::Schema;
use Log::Report mode => 'DEBUG';
use Data::Dumper;
#               Tested with XML::Compile 1.16, XML::Compile::SOAP 2.16, XML::Compile::Cache 0.96, Log::Report 0.28
my $server              = 'uc:pw at nnm_server';
my $subscribewsdl       = "subscribe.wsdl";
my $notify_ns           = 'http://notification.sdk.nms.ov.hp.com/nms-sdk-notify/';
my %xsi_type            = ( 'f:filter' => [ 'f:condition', 'f:constraint', 'f:expression' ] );
my $subscribeAPI        = XML::Compile::WSDL11->new( $subscribewsdl, prefixes => [f => $notify_ns], opts_rw  => {xsi_type => \%xsi_type} );
# patch below suggested by Mark Overmeer
$subscribeAPI->importDefinitions(<<_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
print "IMPORTED PATCH\n";
$subscribeAPI->importDefinitions('ws_eventing.wsdl');
print "IMPORTED : ws_eventing.wsdl\n";
$subscribeAPI->importDefinitions('ws-eventing.xsd');
print "IMPORTED : ws-eventing.xsd\n";
$subscribeAPI->importDefinitions('ws-addr.xsd');
print "IMPORTED : ws-addr.xsd\n";
my $receive_incidents   = $subscribeAPI->compileClient( operation=>'IncidentNotification', server=>$server );
print "CompileClient succeeded\n";
my ($info, $trace)      = $receive_incidents->();

USED WSDL :
<wsdl:definitions targetNamespace="http://notification.sdk.nms.ov.hp.com/nms-sdk-notify" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://notification.sdk.nms.ov.hp.com/nms-sdk-notify" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!- actually imported from file by importDefinitions()
  <wsdl:import location="http://192.49.164.44/nms-sdk-notify/subscribe?wsdl&resource=ws-eventing.wsdl" namespace="http://schemas.xmlsoap.org/ws/2004/08/eventing" />
-->
<wsdl:types>
<!-- actually imported from file by importDefinitions()
  <xs:schema targetNamespace="http://schemas.xmlsoap.org/ws/2004/08/eventing">
        <xs:include schemaLocation="http://192.49.164.44/nms-sdk-notify/subscribe?wsdl&resource=ws-eventing.xsd" />
  </xs:schema>
-->
        <xs:schema blockDefault="#all" elementFormDefault="unqualified"         targetNamespace="http://notification.sdk.nms.ov.hp.com/nms-sdk-notify">
<xs:complexType name="incidentNotification">
<xs:sequence>
  <xs:element minOccurs="0" name="category" type="xs:string" />
  <xs:element name="duplicateCount" type="xs:int" />
  <xs:element minOccurs="0" name="family" type="xs:string" />
  <xs:element minOccurs="0" name="firstOccurrenceTime" type="xs:dateTime" />
  <xs:element minOccurs="0" name="id" type="xs:string" />
  <xs:element minOccurs="0" name="lastOccurrenceTime" type="xs:dateTime" />
  <xs:element minOccurs="0" name="name" type="xs:string" />
  <xs:element minOccurs="0" name="nature" type="tns:nature" />
  <xs:element minOccurs="0" name="origin" type="tns:origin" />
  <xs:element minOccurs="0" name="originOccurrenceTime" type="xs:dateTime" />
  <xs:element minOccurs="0" name="priority" type="xs:string" />
  <xs:element name="rcaActive" type="xs:boolean" />
  <xs:element minOccurs="0" name="formattedMessage" type="xs:string" />
  <xs:element minOccurs="0" name="lifecycleState" type="xs:string" />
  <xs:element minOccurs="0" name="severity" type="tns:severity" />
  <xs:element minOccurs="0" name="sourceName" type="xs:string" />
  <xs:element minOccurs="0" name="sourceNodeName" type="xs:string" />
  <xs:element minOccurs="0" name="sourceNodeLongName" type="xs:string" />
  <xs:element minOccurs="0" name="sourceNodeUuid" type="xs:string" />
  <xs:element minOccurs="0" name="sourceUuid" type="xs:string" />
  <xs:element minOccurs="0" name="uuid" type="xs:string" />
  <xs:element name="incidentResent" type="xs:int" />
  <xs:element minOccurs="0" name="created" type="xs:dateTime" />
  <xs:element minOccurs="0" name="updateTime" type="xs:dateTime" />
  <xs:element minOccurs="0" name="previousLifecycleState" type="xs:string" />
  <xs:element minOccurs="0" name="previousRcaActive" type="xs:string" />
  <xs:element maxOccurs="unbounded" minOccurs="0" name="cias" nillable="true" type="tns:cia" />
  </xs:sequence>
  </xs:complexType>
<xs:complexType name="incidentCorrelation">
<xs:sequence>
  <xs:element minOccurs="0" name="name" type="xs:string" />
  <xs:element minOccurs="0" name="type" type="tns:correlationType" />
  <xs:element minOccurs="0" name="parent" type="xs:string" />
  <xs:element minOccurs="0" name="firstOccurrenceTime" type="xs:dateTime" />
  <xs:element name="correlationResent" type="xs:int" />
  <xs:element maxOccurs="unbounded" minOccurs="0" name="children" nillable="true" type="xs:string" />
  </xs:sequence>
  </xs:complexType>
<xs:complexType name="cia">
<xs:sequence>
  <xs:element minOccurs="0" name="name" type="xs:string" />
  <xs:element minOccurs="0" name="type" type="xs:string" />
  <xs:element minOccurs="0" name="value" type="xs:string" />
  </xs:sequence>
  </xs:complexType>
<xs:simpleType name="severity">
<xs:restriction base="xs:string">
  <xs:enumeration value="CRITICAL" />
  <xs:enumeration value="MAJOR" />
  <xs:enumeration value="MINOR" />
  <xs:enumeration value="WARNING" />
  <xs:enumeration value="NORMAL" />
  </xs:restriction>
  </xs:simpleType>
<xs:simpleType name="nature">
<xs:restriction base="xs:string">
  <xs:enumeration value="ROOTCAUSE" />
  <xs:enumeration value="SECONDARYROOTCAUSE" />
  <xs:enumeration value="SYMPTOM" />
  <xs:enumeration value="SERVICEIMPACT" />
  <xs:enumeration value="STREAMCORRELATION" />
  <xs:enumeration value="NONE" />
  <xs:enumeration value="INFO" />
  </xs:restriction>
  </xs:simpleType>
<xs:simpleType name="origin">
<xs:restriction base="xs:string">
  <xs:enumeration value="MANAGEMENTSOFTWARE" />
  <xs:enumeration value="MANUALLYCREATED" />
  <xs:enumeration value="REMOTELYGENERATED" />
  <xs:enumeration value="SNMPTRAP" />
  <xs:enumeration value="SYSLOG" />
  <xs:enumeration value="OTHER" />
  </xs:restriction>
  </xs:simpleType>
<xs:simpleType name="correlationType">
<xs:restriction base="xs:string">
  <xs:enumeration value="APA" />
  <xs:enumeration value="IMPACT" />
  <xs:enumeration value="DEDUP" />
  <xs:enumeration value="RATE" />
  <xs:enumeration value="PAIRWISE" />
  <xs:enumeration value="CUSTOM" />
  </xs:restriction>
  </xs:simpleType>
</xs:schema>
</wsdl:types>

<wsdl:message name="IncidentNotificationMsg">
  <wsdl:part name="arg0" type="tns:incidentNotification" />
</wsdl:message>

<wsdl:portType name="IncidentNotificationSource" wse:EventSource="true">
  <wsdl:operation name="IncidentNotification">
    <wsdl:output message="tns:IncidentNotificationMsg" />
  </wsdl:operation>
</wsdl:portType>

<wsdl:binding name="IncidentNotificationSourceBinding" type="tns:IncidentNotificationSource">
  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
  <wsdl:operation name="IncidentNotification">
    <soap:operation soapAction="" />
    <wsdl:output>
      <soap:body use="literal" />
    </wsdl:output>
  </wsdl:operation>
</wsdl:binding>

</wsdl:definitions>

Any ideas what could be wrong ?

BR,
  Tapio


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20100823/41563d3b/attachment-0001.htm


More information about the Xml-compile mailing list