SoapClient php extension for sites authentication

Short version

I want to expand SoapClientso that he does this when accessing the WSDL:

curl -L -E /location/of/cert.pem -c /tmp/location/of/cookie.jar https://web-service-provider/servicename?wsdl

Long version

I have a SOAP request like this:

$serviceUrl = 'https://service-url';
$wsdl = $serviceUrl . '?wsdl';

$proxyServiceUrl = 'http://localhost/myproxy.php?url=$serviceUrl';
$proxyWsdl = 'http://localhost/myproxy.php?url=$wsdl';

$options = array(
  'cache_wsdl'    => WSDL_CACHE_NONE,
  'encoding'      => 'utf-8',
  'soap_version'  => SOAP_1_1,
  'exceptions'    => true,
  'trace'         => true,
  'location'      => $proxyServiceUrl
);

$client = new SoapClient($proxyWsdl, $options);

$params = array( /* */ );
$client->someOperation($params);

As you can see, everything is pretty standard, except for the proxy server.

Reason proxy

I wrote a proxy to fulfill the requirement of the web service provider so that all endpoints, including WSDL, are processed through an authentication system called siteminder.

The proxy function is quite simple, if it is written in the linux linear command line, it will be something like this:

curl -L -E /location/of/cert.pem -c /tmp/location/of/cookie.jar https://web-service-provider/servicename?wsdl

To be precise:

* Follow all redirections
* specify location of .pem file (and password)
* specify location of cookie jar

All this works great :)

BUT recently, the service provider decided to change the WSDL.

(.xsd), , , WSDL.

WSDL , SoapClient . , !

:

php SoapClient wsdl

, :

SoapClient (, ), siteminder, ?

, - URI ( ), , .

, , - SoapServer.

, , SoapClient.

+5
2

.pem, local_cert SoapClient? cookie, . cookie , ( __getLastResponseHeaders), __setCookie, .

. Wsdl XML-.

proxy_host, proxy_port, proxy_login proxy_password.

+2

All Articles