Page 1 of 1

PHP SOAP with Crowd WSDL

Posted: Mon Sep 29, 2014 5:25 am
by Taqui
I am trying to get in SSO Functionality of Crowd in my custom php Application. For which i intend to use SOAP to authenticate application and user and many more things which can be done in crowd.
The problem is i am new to php and i think ust knowing the basics leads me to nowhere.

At first i am tring to run the below program and the following error i am getting, i dont know what is going wrong with it but i am unable to acheive what i intend to.

Code: Select all

		 		$client = new SoapClient("http://localhost:8095/crowd/services/SecurityServer?wsdl");
 		 		$param = array('in0' => array('credential' => 'password','name' => 'app'));
 		 		$resp=$client->authenticateApplication($param);
 		 		$token = $resp->out->token;
		 		print_r($resp);
and the error i am getting is :banghead:

atal error: Uncaught SoapFault exception: [soap:Server] app in /var/www/html/soaptest.php:7 Stack trace: #0 /var/www/html/soaptest.php(7): SoapClient->__call('authenticateApp...', Array) #1 /var/www/html/soaptest.php(7): SoapClient->authenticateApplication(Array) #2 /var/www/html/soaptest.php(12): authenticateApplication() #3 {main} thrown in /var/www/html/soaptest.php on line 7

Re: PHP SOAP with Crowd WSDL

Posted: Mon Sep 29, 2014 7:26 am
by Celauran
They have a REST API; why are you using SOAP?

Re: PHP SOAP with Crowd WSDL

Posted: Tue Sep 30, 2014 1:43 am
by Taqui
As i am new to this webservices, I have browsed online and though that talking to wsdl will be more convienient than other option.

Re: PHP SOAP with Crowd WSDL

Posted: Tue Sep 30, 2014 7:10 am
by Celauran
REST API will be infinitely less frustrating to use. It's cleaner, for one, and nobody has used SOAP in years, so getting help will also be easier.

Re: PHP SOAP with Crowd WSDL

Posted: Tue Sep 30, 2014 7:19 am
by Taqui
That was comforting. Can you help me out with the rest. I have surfed and found out that the curl should be used to communicate with application. Can you give me some documentation for how to use php with curl and rest api

Re: PHP SOAP with Crowd WSDL

Posted: Tue Sep 30, 2014 7:25 am
by Celauran
I'd recommend using Guzzle over writing the cURL calls yourself. It's cURL under the hood, but nicely abstracted.

Re: PHP SOAP with Crowd WSDL

Posted: Tue Sep 30, 2014 7:25 am
by Celauran
If you want to use raw cURL, though, it's quite well documented.

Re: PHP SOAP with Crowd WSDL

Posted: Wed Oct 01, 2014 1:39 am
by Taqui
Thank you very much. Will surely bother you if have some problems in the pursuit.