Runtime error with reference to WCF service
I created a reference to an IIS hosted WCF service in my ASP.NET website project on my local workstation using the Add Service Reference option in Visual Studio 2008. I was able to execute this service from my local workstation.
When I move an ASP.NET website using the Copy Website feature in Visual Studio 2008 to a development server and view a page that uses this service, I get the following error:
Reference.svcmap: The specified argument was out of range.
Has anyone experienced this same error and knows how to solve it?
EDIT: My development server is Win2k3 with IIS 6
source to share
@Sixto Saez: I was able to use the following resource similar to the one you provided to create a proxy class using the ServiceModel Metadata Utility Tool (svcutil.exe).
Here is the exact command line:
svcutil /t:code http://<service_url> /out:<file_name>.cs /config:<file_name>.config
Here's a link I found that suggested using the method.
Also, I was able to consume the service by creating a link using the Visual Studio 2008 Add Web Link command. It generates code based on the .NET Framework 2.0 Web Services technology.
source to share
The problem may be due to a mismatch between the solution / project folder structure and the folder structure of the IIS website. I used to run into similar problems and ended up changing the way I deploy web services. Here and here discuss similar problems with i.e. they did not use the created Add Service client and rolled back their own client. In addition, I can vouch for using the Publish Web Site method to deploy my services. Here is a good article on web service deployment models.
source to share