Thursday, 23 October 2008

Allow remote access to .NET Web Service


When accessing a .NET webservice remotely, you may receive a message stating:
"You can only access this resource from its localhost.".

To resolve this, you will need to add permissions for external users to access the service over certain protocols.

Add the following to the web.config file of the web service...

<configuration>
    <system.web>
    <webservices>
        <protocols>
            <add name="HttpGet">
            <add name="HttpPost">
        </protocols>
    </webservices>
    </system.web>
</configuration>


This will allow access via. GET and POST. You may require SOAP here if you are not accessing via. GET or POST.

Sean

No comments: