Remote function call using SOAP::Lite

笑着哭i 提交于 2019-11-28 12:17:01

问题


I'm trying to write a client application in Perl using SOAP::Lite. I am trying to call a specific function, but I cannot seem to get the parameters right. I keep getting a response back saying "Found more elements in the soap envelope than required by the WSDL", but no more information beyond that.

Is there any way in SOAP::Lite to directly find out the parameters needed for the remote procedure call?

Thank you.


回答1:


I navigated by a combination of reading the WSDL and dumping out SOAP::Lite objects as I could manufacture them.

Below is the way that I was able to pick through the returns from SOAP::Lite. Keep in mind that I'm working around some of the bugs in SOAP::Lite by avoiding the SOAP::Schema::load call, and avoiding SL's dislike of more than one defined service in a WSDL, where it kindly croaks on you.

use strict;
use warnings;
use Data::Dumper qw<Dumper>;
use SOAP::Lite; #  trace => 'all'; # <- trace can help

my $schema   = SOAP::Schema->new( schema_url => $destination_URL )->parse();
my $services = $schema->services();
my $defintion;
foreach my $service ( values %$services ) { 
    $definition = $service->{$method_name};
}

print Dumper( $definition );

Most of variables that are not defined above are things that you would have to supply.



来源:https://stackoverflow.com/questions/3143603/remote-function-call-using-soaplite

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!