繁体   English   中英

Perl WSDL11无法使其在两个WSDL文件上工作

[英]Perl WSDL11 Can't Make it to Work on two WSDL files

该问题与我在使用XML :: Compile :: WSD11 Perl模块的Perl程序中遇到的问题有关,在该模块中,我的公司Web服务将多个WSDL与XML导入一起使用。

描述此问题的原始帖子可以在这里找到。 那篇文章中,我尝试了imatveev13的建议,以使用XML :: Compile :: WSDL11的addWSDL API,下面显示了代码片段。

测试Perl程序中使用的两个WSDL文件是: WSDL0WSDL1

#!/usr/bin/perl

use 5.018;
use strict;
use warnings;

use Data::Dumper qw{Dumper};

use XML::Compile::SOAP11; # XML::Compile::SOAP 2.x
use XML::Compile::WSDL11;
use XML::Compile::Transport::SOAPHTTP;

my $WSDL0 = 'CamstarWebClient0.wsdl';
my $WSDL1 = 'CamstarWebClient1.wsdl';

# Create service proxy for web service
my $wsdlXml0 = XML::LibXML->new->parse_file($WSDL0);
my $wsdlXml1 = XML::LibXML->new->parse_file($WSDL1);

my $SoapSrv = XML::Compile::WSDL11->new();
$SoapSrv->addWSDL($wsdlXml0);
$SoapSrv->addWSDL($wsdlXml1);

print Dumper($SoapSrv);

# Compile all service methods
my (%SoapOps);
foreach my $SoapOp ($SoapSrv->operations)
{
    print Dumper($SoapOp);
    # XML::Compile::SOAP 2.x
    if ($XML::Compile::SOAP::VERSION > 1.99)
    {
        $SoapOps{$SoapOp->name}
            = $SoapSrv->compileClient(operation => $SoapOp->name, 
                                      port => "ICamstar");
    }
}

print "\n";
exit;

运行代码给我一个错误:无法找到端口“ ICamstar”,请从BasicHttpBinding_ICamstar中进行选择

我也尝试不指定端口,因为该服务未实现多个端口,但给了我一个不同的错误。

在/usr/local/share/perl5/XML/Compile/SOAP.pm行155处无法通过包“ XML :: Compile :: SOAP11 :: Client”找到对象方法“ _writer_body_rpcenc_hook”

感谢社区的任何帮助。 谢谢。

确保在脚本顶部使用模块XML::Compile::SOAP11::Encoding

use XML::Compile::SOAP11::Encoding;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM