note 116075 added to class.soapclient

From: Date: Thu, 06 Nov 2014 08:35:50 +0000
Subject: note 116075 added to class.soapclient
Groups: php.notes 
Request: Send a blank email to php-notes+get-200799@lists.php.net to get a copy of this message
Using Zimbra 8.5 server as SOAP server i found that you first need to authenticate yourself using [b]authRequest[/b] then using [b]authToken[/b] from the [b]authResponse[/b] to form a header. Without a valid SOAPHeader you will get "no valid authtoken present" error. BTW, you may be don't need this if you are running the php scripts on the same server with zimbra <?php //Predefined variables $S = array( "server" => "mail.b-studio.web.id", "username" => "admin", "password" => "mypassword" ); try{ $S["client"] = new soapclient('https://'.$S["server"].'/service/wsdl/ZimbraAdminService.wsdl'); $response = $S["client"]->authRequest(array("name"=>$S['username'],"password"=>$S['password'])); $S["authToken"] = $response->authToken; $S["header"] = new SOAPHeader("urn:zimbra","context",array("authToken"=>$S["authToken"])); $S["client"]->__setSoapHeaders($S["header"]); $response=$S["client"]->GetAllCosRequest(); var_dump($response); }catch (Exception $e){ echo "Exception: {$e->getMessage()}\n"; } ?> ---- Server IP: 72.52.91.14 Probable Submitter: 202.137.23.194 ---- Manual Page -- http://php.net/manual/en/class.soapclient.php Edit -- https://master.php.net/note/edit/116075 Del: integrated -- https://master.php.net/note/delete/116075/integrated Del: useless -- https://master.php.net/note/delete/116075/useless Del: bad code -- https://master.php.net/note/delete/116075/bad+code Del: spam -- https://master.php.net/note/delete/116075/spam Del: non-english -- https://master.php.net/note/delete/116075/non-english Del: in docs -- https://master.php.net/note/delete/116075/in+docs Del: other reasons-- https://master.php.net/note/delete/116075 Reject -- https://master.php.net/note/reject/116075 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#200799) next »