soap - PHP SoapClient with BasicAuth -


i have php script trying connect wsdl. need allow self signed , give basic auth details. using soap ui, when connect wsdl prompted username / password. got working.

i found out each request requires basic auth (so on request screen, have select auth, basic, enter same credentials used on prompt).

how auth in php said, can connect, not problem, seem kill service or timeout if try make request

<?php $context = stream_context_create(array(     'ssl' => array(         'verify_peer' => false,         'verify_peer_name' => false,         'allow_self_signed' => true     )  ));  $data = array(     'columna' => 'dataa',     'columnb' => 'datab',     'columnc' => 'datac');  $url = 'https://111.111.111.111:1234/dir/file'; $login = 'username'; $pwd = 'password';   $client = new soapclient(null, array(      'location' => $url,      'uri' => '',      'login' => $login,      'password' => $pwd,      'stream_context' => $context )); echo "\n\r---connected---\n\r"; $result = $client ->requestname($data);  print_r($result); ?> 

my output ---connected---

then seems hang. have tried wrapping round try catch , had same result.

any suggestions??

try url encoding username , password inside url using:

$url = 'http://'.urlencode('yourlogin').':'.urlencode('yourpassword').'@111.111.111.111:1234/dir/file'; 

also don't see make use of wsdl in code example. can download copy of wsdl locally , reference local copy. can download wsdl anyway want (with php, curl, manually).


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -