Michael Kniskern
Michael Kniskern

Reputation: 25260

Runtime Error with referenced WCF Service

I have created a reference to an IIS hosted WCF service in my ASP.NET website project on my local workstation through the "Add Service Reference" option in Visual Studio 2008. I was able to execute the service from my local workstation.

When I move the ASP.NET web site using the "Copy Web Site" feature in Visual Studio 2008 to the development server and browse to the page consuming the service, I get the following error:

Reference.svcmap: Specified argument was out of the range of valid values.

Has anyone experienced this same error and know how to resolve it?

EDIT: My development server is Win2k3 with IIS 6

Upvotes: 1

Views: 2801

Answers (3)

Michael Kniskern
Michael Kniskern

Reputation: 25260

@Sixto Saez: I was able to use the following resource similar to the one you provided to generate 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 is the reference I found that suggested using the method.

Also, I was able to consume the service by creating a reference using the Visual Studio 2008 "Add Web Reference" command. It generates code based on .NET Framework 2.0 Web Services technology.

Upvotes: 1

Michael Kniskern
Michael Kniskern

Reputation: 25260

Unforunately, the WCF service web site and I can not use the svcutil solution (Unless you know of a way how...). Do you deploy you service or your web site with the service reference using Visual Studio 2008 publish web site feature?

Upvotes: 0

Sixto Saez
Sixto Saez

Reputation: 12680

The problem may be due to a mismatch with the solution/project folder structure and the IIS web site folder structure. I ran into similar problems a good while ago and ended up changing how I deploy web services. Here and here are some discussions of similar problems to yours, they ended up not using the Add Service generated client and rolled their own client. Also, I can vouch for using the "Publish web site" method for deploying my services. Here is a good article on web service deployment models.

Upvotes: 1

Related Questions