function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mark JeffreyMark Jeffrey 

Apex webservice

I have an Apex webservice that I am trying to consume from a simple .net website. I can login into Salesforce using the Enterprise WSDL or the Partnerservice WSDL. But when I try to call the class I get the following error.

System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 96.43.150.232:443 at System.Net.Sockets.Socket.DoConnect

This is connecting to a Sandbox environment.

Any ideas please?
This is my Apex class
global class PAVE_ProjectWebService
{
     webservice static List<PAVE_Project__c> getProjectProposal(String strFilter)
     {
        String SOQL;
       
        SOQL = 'SELECT Project_Name__c,PAVE_Site__r.Name,Status__c FROM PAVE_Project__c ';
        if (strFilter != null) SOQL += 'WHERE ' + strFilter;
        return Database.query(SOQL);
     }
}

I have generated the WSDL for the class.
Best Answer chosen by Mark Jeffrey
Yury BondarauYury Bondarau
Hi Mark,

It is NOT looks like error generated by salesforce. After quick glance on stackexnange I guess it can be an issue with proxy or firewall.

All Answers

Yury BondarauYury Bondarau
Hi Mark,

It is NOT looks like error generated by salesforce. After quick glance on stackexnange I guess it can be an issue with proxy or firewall.
This was selected as the best answer
Mark JeffreyMark Jeffrey
Hi Yury

Thanks for your reply. The issue was that I was trying to test the web service from .NET when hosted locally, not from a web server.
After changing the proxy server settings in IE the web service was consumed successfully. So once deployed to a .NET web server I should not experience this problem. But thanks for pointing me in the right direction. 

Regards
Mark