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.