+ Start a Discussion
Sreenu Reddy 16Sreenu Reddy 16 

trailhead task SOAP

Challenge not yet complete in My Trailhead Playground 1
There was an unexpected error in your org which is preventing this assessment check from completing: System.CalloutException: IO Exception: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://th-apex-soap-service.herokuapp.com/parks
Sreenu Reddy 16Sreenu Reddy 16
End point Url Class :
//Generated by wsdl2apex

public class ParkService {
    public class byCountryResponse {
        public String[] return_x;
        private String[] return_x_type_info = new String[]{'return','http://parks.services/',null,'0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://parks.services/','false','false'};
        private String[] field_order_type_info = new String[]{'return_x'};
    }
    public class byCountry {
        public String arg0;
        private String[] arg0_type_info = new String[]{'arg[0]','http://parks.services/',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://parks.services/','false','false'};
        private String[] field_order_type_info = new String[]{'arg0'};
    }
    public class ParksImplPort {
        public String endpoint_x ='https://th-apex-soap-service.herokuapp.com/services/parks';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://parks.services/', 'ParkService'};
        public String[] byCountry(String arg0) {
            ParkService.byCountry request_x = new ParkService.byCountry();
            request_x.arg0 = arg0;
            ParkService.byCountryResponse response_x;
            Map<String, ParkService.byCountryResponse> response_map_x = new Map<String, ParkService.byCountryResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://parks.services/',
              'byCountry',
              'http://parks.services/',
              'byCountryResponse',
              'ParkService.byCountryResponse'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.return_x;
        }
    }
}

Please help on this i didn't find my mistake here. thanks you.
Khan AnasKhan Anas (Salesforce Developers) 
Hi Sreenu,

Greetings to you!

I think the endpoint which you have configured in the remote site setting is incorrect. Try to check the URL by going to Setup--> Security--> Remote Site Settings. 
Before any Apex callout can call an external site, that site must be registered in the Remote Site Settings page.

Please refer to the below link which might help you further with the above requirement.

https://developer.salesforce.com/forums/?id=906F0000000MIwfIAG

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Sreenu Reddy 16Sreenu Reddy 16
HI Khan,

.i created remote site setting properly  i checked above link  ParkService.ParksImplPort park = new ParkService.ParksImplPort();But   
 i got same issue
Thanks 
Srinivas