[Xml-compile] XML::Compile fails with "operation direction `notification-operation' not supported"

Tapio.Niva at tieto.com Tapio.Niva at tieto.com
Thu Dec 9 07:46:47 GMT 2010


Hello,
I tried to test WS-Eventing with XML::Compile, but it failed with "operation direction `notification-operation' not supported".

The used WSDLs contain some imports/includes, but they are commented away and actually imported within perl code below with importDefinitions().
---< START OF PERL >--------
#!/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.19, XML::Compile::SOAP 2.19, XML::Compile::Cache 0.97, Log::Report 0.26
#
my $server		= 'uc:pw at 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";

# subscribe.wsdl:  <wsdl:import location="http://server/nms-sdk-notify/subscribe?wsdl&resource=ws-eventing.wsdl" 
#					namespace="http://schemas.xmlsoap.org/ws/2004/08/eventing" /> 
$subscribeAPI->importDefinitions('ws-eventing.wsdl');
print "IMPORTED : ws_eventing.wsdl\n";

#subscribe.wsdl:   <xs:include schemaLocation="http://server/nms-sdk-notify/subscribe?wsdl&resource=ws-eventing.xsd" /> 
$subscribeAPI->importDefinitions('ws-eventing.xsd');
print "IMPORTED : ws-eventing.xsd\n";

# ws-eventing.xsd: <xs:import namespace='http://www.w3.org/2005/08/addressing' schemaLocation='ws-addr.xsd'/>
$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->();
----< END OF PERL >-----

---< TAIL OF ERRORLOG >------
trace: loading extension XML::Compile::Transport::SOAPHTTP
error: operation direction `notification-operation' not supported for IncidentNotification
 at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP/Client.pm line 31
XML::Compile::SOAP::Client::compileClient(XML::Compile::SOAP11::Client=HASH(0x17d61ef0), "name", "IncidentNotification", "kind", "notification-operation", "encode", CODE(0x17dea350), "decode", [5 more]) at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP11/Operation.pm line 250
XML::Compile::SOAP11::Operation::compileClient(XML::Compile::SOAP11::Operation=HASH(0x17d59b40), "operation", "IncidentNotification", "server", "uc:pw at server") at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/WSDL11.pm line 326
XML::Compile::WSDL11::compileClient(XML::Compile::WSDL11=HASH(0x17b21090), "operation", "IncidentNotification", "server", "uc:pw at server") at ./test_XML_compile.pl line 44
---< END OF ERRORLOG >-----

---< 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">
<!--  NOTE: IMPORTED WITHIN PERL <wsdl:import location="http://sheridan/nms-sdk-notify/subscribe?wsdl&resource=ws-eventing.wsdl" namespace="http://schemas.xmlsoap.org/ws/2004/08/eventing"  /> -->
<wsdl:types>
<xs:schema targetNamespace="http://schemas.xmlsoap.org/ws/2004/08/eventing">
<!--  NOTE: IMPORTED WITHIN PERL <xs:include schemaLocation="http://sheridan/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>
---< END OF USED WSDL >----------

As my knowledge is quite poor on WSDL/SOAP, any ideas of how to proceed will be appreciated !

(Please note that due to email size restrictions, the imported ws-eventing.wsdl, ws-eventing.xsd and ws-addr.xsd were left out, but can be provided on separate email, if needed)

BR, Tapio




More information about the Xml-compile mailing list