Rest API call using curl always throwing error in PA server? properly working in local server.

Below error getting in  PA Server. Execution of configuration script for instance with id 5767 of service with id Create Account of instance with id 3654 of application with id 4199 failed – returned value: ‘ errors: ‘* About to connect() to 198.–.–.– port 8080 * Trying 198.–.–.–… * connected * Connected to 198.–.–.– (198.–.–.–)… Read More »

Error Displaying in APS Package or validating an entered field

Sample code $str = “<?xml version=’1.0′ encoding=’UTF-8′?>”; $str.= ‘<output xmlns=”http://apstandard.com/ns/1/configure-output”><settings>’; $errorMessages=”mydoubts.in already exists”; $errsetting=’domainname’; $str .= ‘<errors>’; $str .= ‘<error id=”‘.$errsetting.’” setting-id=”‘.$errsetting.’”>’; $str .= ‘<message>’.$errorMessages.'</message><system>’.$errorMessages.'</system></error>’; $str .= ‘</errors>’; $str .= ‘</settings>’; echo $str;

Storing a value into the settings variable in aps package.

Below sample code will execute through verification script will work sample code to load a country dropdownbox. $str = “<?xml version=’1.0′ encoding=’UTF-8′?>”; $str .= ‘<output xmlns=”http://apstandard.com/ns/1/configure-output”><settings><setting id=”country”>’; foreach () { $str .=    ‘<choice id=”‘.$id.’”><name>’.htmlspecialchars($cname).'</name></choice>’; } $str .= ‘</setting></settings>’; echo $str;

Sample Rest aPi call in php using curl

$service_url = ‘http://mydoubts.com’; $inputdata='<?xml version=”1.0″ encoding=”utf-8″?> <username>mydoubts</username> <domain>mydoubts.in</domain> <email>contact@mydoubts.in</email>’; curl_setopt($curl, CURLOPT_HTTPHEADER, array(“Content-Type: application/xml”)); curl_setopt($curl, CURLOPT_POST, true); // Do a regular HTTP POST curl_setopt($curl, CURLOPT_POSTFIELDS, $inputdata); // Set POST data curl_setopt($curl, CURLOPT_URL, $service_url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_HEADER, 1); // return HTTP headers with response curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl);