使用 SOAP::Lite 的远程函数调用 [英] Remote function call using SOAP::Lite
问题描述
我正在尝试使用 SOAP::Lite 在 Perl 中编写客户端应用程序.我试图调用一个特定的函数,但我似乎无法正确获取参数.我不断收到回复说在肥皂信封中找到的元素比 WSDL 要求的多",但除此之外没有更多信息.
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.
SOAP::Lite 有没有办法直接找出远程过程调用需要的参数?
Is there any way in SOAP::Lite to directly find out the parameters needed for the remote procedure call?
谢谢.
推荐答案
我通过阅读 WSDL 和倾销 SOAP::Lite
对象的组合来导航,因为我可以制造它们.
I navigated by a combination of reading the WSDL and dumping out SOAP::Lite
objects as I could manufacture them.
下面是我能够从 SOAP::Lite
中挑选返回的方法.请记住,我正在通过避免 SOAP::Schema::load
调用来解决 SOAP::Lite
中的一些错误,并避免 SL 不喜欢更多而不是 WSDL 中定义的一个服务,它会善意地向您发出嘶嘶声.
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.
这篇关于使用 SOAP::Lite 的远程函数调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!