Requesting SOAP using CURL on Codieigniter 4 |
I am consuming a service using CURL. I am able to connect all the functions of the services in the form of a CXF Service List using the following code.
$client = \Config\Services::curlrequest();
Code: $response = $client->request('GET', 'www.soapservice.co.za/service'); Var Dump Returns a string with Available services
The service has 10 functions listed in this manner getDataFunction.
How do i invoke the function? Or how do i get the contents of the body and start using Service functions ?
Any help would be appreciatedI was using SoapClient on CI3 now I have moved to CI4 and the same SoapClient code that worked on CI3 does not work on CI4. Does CI4 Support SOAP? I would use soap client too as it was much easier for me. I am very new to CURL. If you have a solution i would appreciate it. The service was developed using Java and it returns CXF Service List with all Available functions.
You will need to provide us with code on how you use the SoapClient and what error you get. I guess you mean the official one?
https://www.php.net/manual/en/class.soapclient.php Most likely you need to put \ in front of every function. From: SoapClient Into: \SoapClient
(06-01-2020, 02:26 PM)jreklund Wrote: You will need to provide us with code on how you use the SoapClient and what error you get. I guess you mean the official one?Thank you so much. That work :-) Really Appreciate it jreklund
Can you indeed show an example of how you made that work? I too have to deal with SOAP calls in CI4 and have no clue on how to do it
![]()
(06-02-2020, 01:42 AM)korgoth Wrote: Can you indeed show an example of how you made that work? I too have to deal with SOAP calls in CI4 and have no clue on how to do itHere you go public function test() { $url = ''; $client = new \SoapClient($url); $response = $client->getOfficeRegistryList(); var_dump($response); $office = $response->return; foreach($office as $row) { echo $row->fullDescription; echo "<br>"; } } I hope this will be helpful |
Welcome Guest, Not a member yet? Register Sign In |