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 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?