通过旧 Perl 版本的 Web 服务
当我使用升级版本的perl时(当然,也升级版本的soap::lite) 所以我用所有需要的方法成功连接到我的服务器。 当我使用较旧的 perl 版本(当然,还有较旧版本的soap::lite)移动时,因此信封创建方式不同,并且我没有成功调用获取参数的服务器方法 出色地。 是否需要更改代码或仅更改模块? 如果可以通过代码进行更改,那么我需要更改哪些内容。现在我的代码如下所示:
my $ws_url = '$url';
my $ws_uri = '$uri';
my $ws_xmlns = '$xmlns';
eval
{
my $soap = SOAP::Lite
-> uri( $ws_uri)
-> on_action(sub{sprintf '%s', @_})
-> proxy($ws_url,timeout => 15);
my @params = ( SOAP::Data->name(Add => "$paramAdd"));
$response = $soap->EndUnit(@params);
if($response->fault)
{
# die raises an exception
print "=======fault happened=====\n";
die $response->faultstring;
}
else
{
print $response->result;
print "\n";
}
};
if ($@)
{
print "$@\n";
print "Failed \n";
};
非常感谢您的帮助! 诺亚:-)
when I am using upgrade version of perl (ofcourse, also upgrade version of soap::lite)
so I successfully connect to my server with all needed methods.
when I moved using older perl version (ofcourse, also older version of soap::lite), so envelope created differently, and I did not success invoke server methods which got params
well.
Is there need change something in code or only in modules?
If change can be done thru code, so which thing I need to change. for now my code look like:
my $ws_url = '$url';
my $ws_uri = '$uri';
my $ws_xmlns = '$xmlns';
eval
{
my $soap = SOAP::Lite
-> uri( $ws_uri)
-> on_action(sub{sprintf '%s', @_})
-> proxy($ws_url,timeout => 15);
my @params = ( SOAP::Data->name(Add => "$paramAdd"));
$response = $soap->EndUnit(@params);
if($response->fault)
{
# die raises an exception
print "=======fault happened=====\n";
die $response->faultstring;
}
else
{
print $response->result;
print "\n";
}
};
if ($@)
{
print "$@\n";
print "Failed \n";
};
Thanks a lot ahead for your help!
Noa :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看您正在使用的 SOAP::Lite 版本之间的更改: 更改
另外,您应该列出您正在谈论的 Perl 和 SOAP::Lite 的版本。
Take a look at the changes between the versions of SOAP::Lite you are using : Changes
Also, you shold list what versions of Perl and SOAP::Lite you are talking about ..