Monday, August 30, 2010

Web service project host on remote server

I was moving my project codes to the Remote host server. Actually It's a Silverlight Project and thank god we have Web service support in Silverlight to manage Database stuffs. So I did it well and my client really impressed with my work (Thanks to the magic done by the Silverlight. I really love Silverlight now :) ) So I decided to host it to server from my development environment.

Definitely I've to make sure that my Web service project is working perfectly, because everything depends on that. I hosted it and pulled the URL from my browser. It was nice to see that the web page lists all the WebMethods written to support my application. I clicked one of them to test from there itself that it is pulling data properly and outputs the exact XML. Page moved to the specific function test page to invoke and test the function(Thanks to .Net that we have very nice UI to test the Web service functions.)

But suddenly it shocked me that my "Invoke" button is missing instead it shows "The test form is only available for requests from the local machine". For a moment it made me mad because I've committed the entire application to the client before evening.

But nothing to worry I suppose, as usual google brought the quickest solution. It's just a matter of adding a protocol section in the web.config file. So see bellow it goes like this.

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

Thats it! now everything fine. Thanks for a cool week start :)

No comments: