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

Mark Overmeer mark at overmeer.net
Mon Sep 20 14:26:19 GMT 2010


* Tapio.Niva at tieto.com (Tapio.Niva at tieto.com) [100920 09:04]:
> I had previously a namespace problem with wsdl containing rpc style.
> MarkOv suggested the following change to lib/XML/Compile/SOAP11/Operation.pm :
>  
> Original code :
>    if($style eq 'rpc')
>     {   exists $body->{namespace}
>             or error __x"rpc operation {name} requires namespace attribute"
>                  , name => $msgname;
>  
> Changed code :
>     if($style eq 'rpc')
>     {   my $ns = $body->{namespace} || '';
>         $procedure = pack_type $ns, $opname;

"namespace" is option, according to the schema, so probably the latter is
more correct than the former... on the other hand, the description says
that namespace is required... SOAP spec is poor.

I will simplify the whole block into

        my $procedure 
            = $style eq 'rpc' ? pack_type($body->{namespace}, $opname)
            : @parts==1 && $parts[0]{type} ? $msgname 
            : $local;

Minor detail: now, when $body->{namespace} is missing, the element name
will be "$opname".  In my previous suggestion, it results in "{}$opname"
Something tells me that your server simply ignores namespaces...

> I assumed that this also could be not-so-critical error and skipped it via a
> small change to /usr/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP.pm rows
> 111-117:
>  
> Original code :
>>     elsif($style eq 'rpc')
>     {   my $procedure = $args{body}{procedure}
>           or error __x"sending operation requires procedure name with RPC";
>         push @$hooks, $self->_writer_rpc_hook('SOAP-ENV:Body'
>           , $procedure, $body, $faults);
>     }
> Changed code :
>>     elsif($style eq 'rpc')
>     {   my $procedure = $args{body}{procedure} || '';                   ##
> locally added
>       ##      or error __x"sending operation requires procedure name with RPC";
>   ## locally skipped error message
>         push @$hooks, $self->_writer_rpc_hook('SOAP-ENV:Body'
>           , $procedure, $body, $faults);
>     }

This is unexpected, because the procedure should at least contain
the $opname  The value is set in the code-fragment on top... seems
like a typo somewhere. Maybe you can dump $args{body}.

> After these changes, my WS-EVENTING test using XML::Compile gave good
> results !

Well, glad it does ;-)

> QUESTIONS:
> Do you see any risk on these changes - are the changes dangerous to the other
> module logic ?

No.

> Are the above changed rpc-style tests only to make sure that the wsdl is
> following the standard specs ?

Yes. Part of the code is only "discovered" from people reporting bugs,
because there are no docs nor sufficient examples around.
-- 
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