dsovc00684 2017-02-08 19:06
浏览 445

PHP soap客户端错误:未知的WSDL扩展名

I've made some research and didn't find a solution for this. I have a PHP SOAP Client and I try to stablish a connection with a SAP WebService, but there is a required policy in the wsdl that I don't know how to set when I try to create the client in PHP. Here's part of the WSDL:

<wsdl:definitions xmlns:wsdl="http://schemas..." xmlns:wsu="http://doc....xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:p1="http..." targetNamespace="http..." name="SI_Sucursal_OS">
    <wsdl:documentation/>
    <wsp1_2:UsingPolicy xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" wsdl:required="true"/>
    <wsp1_2:Policy xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" wsu:Id="OP_SI_Sucursal_OS"/>
    <wsdl:types>...

The error:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://schemas.xmlsoap.org/ws/2004/09/policy' in ...

And the code for the client:

ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl', 900);
ini_set('default_socket_timeout', 15);

$user     = 'user';
$password = 'password';
$wsdl     = 'http:...';

$SOAP_CONFIG = array(
    'login' => $user,
    'password' => $password,
    'authentication' => SOAP_AUTHENTICATION_BASIC,
    'soap_version' => SOAP_1_1,
    'connection_timeout' => 15,
    'encoding' => 'UTF-8'
);

$client = new SoapClient($wsdl, $SOAP_CONFIG);

Also, when i save the wsdl and change the part:

<wsp1_2:UsingPolicy ... wsdl:required="true"/>

to false, i can create the Client, but the idea it's to use the url location of the web service, not a local modified file. I've checked the solutions posted here:

PHP SoapClient: Unknown required WSDL extension

But none of them seems to apply to me.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记