soap client - PHP SoapClient - how to get request to server and response -


i try create script communication ws-security (for first time) in php:

require ('wssoapclient.php'); $soapclient = new wssoapclient('https://katastr.cuzk.cz/trial/dokumentace/ws22/wsdp/vyhledat_v22.wsdl'); $soapclient->__setusernametoken('username', 'password'); $params = array('katastruzemikod'=>693936, 'kmenovecislo'=>1385); $response = $soapclient->__soapcall('najdiparcelu', $params); var_dump($response); 

and script failed:

php fatal error: uncaught soapfault exception: [wsse:invalidsecurity] error on verifying message against security policy error code:1000 in /home/jura/bin/wssoapclient.php:75

is way see, script sent server , response?

the problem $soapclient->__setusernametoken('username', 'password') function expecting 3rd parameter of either 'passworddigest' or 'passwordtext'.

this badly handled in wssoapclient class. should throw exception if passwordtype argument missing. tries this:

// $this->generatewssecurityheader() returns empty string if 3rd parameter missing.  $this->__setsoapheaders($this->generatewssecurityheader()); 

if php in strict mode mine these warnings:

php warning: soapclient::__setsoapheaders(): invalid soap header...

warning: soapclient::__setsoapheaders(): invalid soap header...

you need figure out password type , pass 3rd argument in setusernametoken() function.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -