FW: [Xml-compile] error: sending operation requires procedure name with RPC

Tapio.Niva at tieto.com Tapio.Niva at tieto.com
Wed Aug 25 08:53:06 GMT 2010


Hello,
thanks for hints with the namespace problem.
I did not patch the Operation.pm, but added the namespace to Vendor's WSDL as follows :
        <soap:body use="literal" namespace="http://notification.sdk.nms.ov.hp.com/nms-sdk-notify"/>
I believe that the Vendor will add the namespace definition to their WSDL if we request it, so no need to patch XML::Compile for that.

After the above change, my actual test went forward a bit, but ended with "error: sending operation requires procedure name with RPC".

I may have understood wrong, but on subscribe.WSDL used on test I see that the operation name to be called is "IncidentNotification".
Should there also be a separate definition of a "procedure name" ?
Where should the "procedure name" be on WSDL?

Test results :
--------------
...
trace: cache parsed file soap-encoding.xsd-1281535998-18427
trace: parsing XML from file /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP11/xsd/soap-encoding.xsd
trace: cache parsed file soap-envelope.xsd-1281535998-6032
trace: parsing XML from file /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP11/xsd/soap-envelope.xsd
trace: cache parsed file soap-envelope-patch.xsd-1281535998-796
trace: parsing XML from file /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP11/xsd/soap-envelope-patch.xsd
trace: register prefix SOAP-ENV for 'http://schemas.xmlsoap.org/soap/envelope/'
trace: register prefix SOAP-ENC for 'http://schemas.xmlsoap.org/soap/encoding/'
trace: register prefix xsd for 'http://www.w3.org/2001/XMLSchema'
trace: schema compile WRITER for {http://schemas.xmlsoap.org/soap/envelope/}Fault
trace: schema compile WRITER for {http://schemas.xmlsoap.org/soap/envelope/}Fault
error: sending operation requires procedure name with RPC
 at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP.pm line 112
XML::Compile::SOAP::_sender(XML::Compile::SOAP11::Client=HASH(0x82d3460), "body", HASH(0x8334940), "kind", "notification-operation", "style", "rpc", "operation", [5 more]) at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP11.pm line 148
XML::Compile::SOAP11::_sender(XML::Compile::SOAP11::Client=HASH(0x82d3460), "faults", HASH(0x7e170e0), "kind", "notification-operation", "style", "rpc", "server", [3 more]) at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP11/Operation.pm line 260
XML::Compile::SOAP11::Operation::compileClient(XML::Compile::SOAP11::Operation=HASH(0x82d3500), "operation", "IncidentNotification", "server", "uc:pw at nnm_server") at /usr/lib/perl5/site_perl/5.8.8/XML/Compile/WSDL11.pm line 323
XML::Compile::WSDL11::compileClient(XML::Compile::WSDL11=HASH(0x808fdd0), "operation", "IncidentNotification", "server", " uc:pw at nnm_server ") at ./test_XML_compile.pl line 37
?


Test script used:
----------------------------
#!/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 subscribe.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">
<!--
  <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>
        <!--
        <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" namespace="http://notification.sdk.nms.ov.hp.com/nms-sdk-notify"/>
    </wsdl:output>
  </wsdl:operation>
</wsdl:binding>

Imported ws_eventing.wsdl :
-------------------------------
</wsdl:definitions>
<wsdl:definitions targetNamespace="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 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">
<!-- <
wsdl:types>
  <xs:import namespace="http://schemas.xmlsoap.org/ws/2004/08/eventing" schemaLocation="http://schemas.xmlsoap.org/ws/2004/08/eventing/eventing.xsd" />
</wsdl:types>
-->
<wsdl:message name="GetStatusResponseMsg">
  <wsdl:part element="wse:GetStatusResponse" name="body" />
  </wsdl:message>
<wsdl:message name="GetStatusMsg">
  <wsdl:part element="wse:GetStatus" name="body" />
  </wsdl:message>
<wsdl:message name="RenewResponseMsg">
  <wsdl:part element="wse:RenewResponse" name="body" />
  </wsdl:message>
<wsdl:message name="SubscriptionEnd">
  <wsdl:part element="wse:SubscriptionEnd" name="body" />
  </wsdl:message>
<wsdl:message name="RenewMsg">
  <wsdl:part element="wse:Renew" name="body" />
  </wsdl:message>
<wsdl:message name="SubscribeMsg">
  <wsdl:part element="wse:Subscribe" name="body" />
  </wsdl:message>
<wsdl:message name="SubscribeResponseMsg">
  <wsdl:part element="wse:SubscribeResponse" name="body" />
  </wsdl:message>
<wsdl:message name="UnsubscribeMsg">
  <wsdl:part element="wse:Unsubscribe" name="body" />
  </wsdl:message>
  <wsdl:message name="UnsubscribeResponseMsg" />
<wsdl:portType name="SubscriptionManager">
<wsdl:operation name="RenewOp">
  <wsdl:input message="wse:RenewMsg" wsa10:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew" />
  <wsdl:output message="wse:RenewResponseMsg" wsa10:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse" />
  </wsdl:operation>
<wsdl:operation name="GetStatusOp">
  <wsdl:input message="wse:GetStatusMsg" wsa10:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus" />
  <wsdl:output message="wse:GetStatusResponseMsg" wsa10:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse" />
  </wsdl:operation>
<wsdl:operation name="UnsubscribeOp">
  <wsdl:input message="wse:UnsubscribeMsg" wsa10:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe" />
  <wsdl:output message="wse:UnsubscribeResponseMsg" wsa10:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse" />
  </wsdl:operation>
  </wsdl:portType>
<wsdl:portType name="EventSource">
<wsdl:operation name="SubscribeOp">
  <wsdl:input message="wse:SubscribeMsg" wsa10:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe" />
  <wsdl:output message="wse:SubscribeResponseMsg" wsa10:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse" />
  </wsdl:operation>
<wsdl:operation name="SubscriptionEnd">
  <wsdl:output message="wse:SubscriptionEnd" />
  </wsdl:operation>
  </wsdl:portType>
<wsdl:binding name="SubscriptionManagerBinding" type="wse:SubscriptionManager">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetStatusOp">
  <soap:operation soapAction="" />
<wsdl:input>
  <soap:body use="literal" />
  </wsdl:input>
<wsdl:output>
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
<wsdl:operation name="RenewOp">
  <soap:operation soapAction="" />
<wsdl:input>
  <soap:body use="literal" />
  </wsdl:input>
<wsdl:output>
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
<wsdl:operation name="UnsubscribeOp">
  <soap:operation soapAction="" />
<wsdl:input>
  <soap:body use="literal" />
  </wsdl:input>
<wsdl:output>
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
<wsdl:binding name="EventSourceBinding" type="wse:EventSource">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="SubscribeOp">
  <soap:operation soapAction="" />
<wsdl:input>
  <soap:body use="literal" />
  </wsdl:input>
<wsdl:output>
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
<wsdl:operation name="SubscriptionEnd">
  <soap:operation soapAction="" />
<wsdl:output>
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
<wsdl:service name="EventingService">
<wsdl:port binding="wse:SubscriptionManagerBinding" name="SubscriptionManagerPort">
  <soap:address location="http://sheridan/nms-sdk-notify/manage" />
  </wsdl:port>
<wsdl:port binding="wse:EventSourceBinding" name="EventSourcePort">
  <soap:address location="http://sheridan/nms-sdk-notify/subscribe" />
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>

---------
BR, Tapio


More information about the Xml-compile mailing list