Skip to content
Advertisement

How to call .net web service using CUrl PHP?

I have .net web service which i need to call using CUrl in php. Can anybody tell me how to achieve this? Below is my code which is not working and throwing Server Error.

Thanks in advance

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,"sample url");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
            "APIKey=sample&sku=&UPC");


curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);

$server_output = curl_exec($ch);

print_r($server_output);
curl_close ($ch);

Please see below error for more information:

enter image description here

Advertisement

Answer

I have used nusoap libraries to call the .net webservices.

Check below link:

https://www.codeproject.com/Articles/140189/PHP-NuSOAP-Tutorial

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement