Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Perl WSDL11无法使用XML导入在WSDL上工作_Xml_Perl_Web Services_Soap_Wsdl - Fatal编程技术网

Perl WSDL11无法使用XML导入在WSDL上工作

Perl WSDL11无法使用XML导入在WSDL上工作,xml,perl,web-services,soap,wsdl,Xml,Perl,Web Services,Soap,Wsdl,我是Perl编程的新手 为了学习访问soap服务,我尝试创建一个可以连接到的soap客户机,我在其中成功地使用了web服务 现在,我迁移了代码以连接到公司的soap服务,但遇到了一个问题 错误表明它们没有端口类型,也没有操作 请参阅下面的代码片段 #!/usr/bin/perl use 5.018; use strict; use warnings; use Data::Dumper qw{Dumper}; use XML::Compile::SOAP11; use XML::Compile

我是Perl编程的新手

为了学习访问soap服务,我尝试创建一个可以连接到的soap客户机,我在其中成功地使用了web服务

现在,我迁移了代码以连接到公司的soap服务,但遇到了一个问题

错误表明它们没有端口类型,也没有操作

请参阅下面的代码片段

#!/usr/bin/perl

use 5.018;
use strict;
use warnings;

use Data::Dumper qw{Dumper};
use XML::Compile::SOAP11;
use XML::Compile::SOAP12;
use XML::Compile::WSDL11;

my $WsdlUrl;
my $WsdlXml;
my $SoapSrvc;
my (%SoapOps);

$WsdlUrl = "http://maxcavmes04/CamstarExternal/camstar.svc";
$WsdlXml = XML::LibXML->new->parse_file($WsdlUrl);
$SoapSrvc = XML::Compile::WSDL11->new($WsdlXml);

print Dumper(\$SoapSrvc);

foreach my $SoapOp ($SoapSrvc->operations())
{
    # XML::Compile::SOAP 2.x
    if ($XML::Compile::SOAP::VERSION > 1.99)
    {
        $SoapOps{$SoapOp->name} 
            = $SoapSrvc->compileClient(operation => $SoapOp->name,
                                       port => SOAP_PORT_TYPE);
    }
    else  # XML::Compile::SOAP 0.7x
    {
        $SoapOps{$SoapOp->{operation}} 
            =  $SoapSrvc->compileClient(operation => $SoapOp->{operation},
                                        port => SOAP_PORT_TYPE);
    }
}

print "\n\n";
exit(0);
我使用了一个名为.NET WebService Studio的第三方软件来进一步研究它为什么不起作用。我从WebServiceStudio返回的消息中意识到,我公司的Soap服务通过WSDL:Import使用两个WSDL文件

我想从这个社区询问如何修改我的程序,以便使用WSDL11访问公司的soap服务

我还通过print Dumper\$SoapSrvc语句附加了soap服务连接的转储数据作为参考

链接:

原因可能是XML::Compile::WSDL11没有加载从wsdl文件引用的xsd。您必须下载您的wsdl文件。阅读它以查找对外部文件的引用,如。下载引用文件检查引用文件。。。当你拥有一切时,你可以像这样使用它:

my $wsdl = XML::Compile::WSDL11->new();
$wsdl->importDefinitions("first.xsd");
$wsdl->importDefinitions("second.xsd");
$wsdl->addWSDL("my_service.wsdl");

如果发布wsdl文件,诊断问题会更容易

请参阅WSDL文件的链接。和