views:

819

answers:

3

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

+1  A: 

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.

Sixto Saez
A: 

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?

Michael Kniskern
I create the web service client using svcutil. I take the code and put in separate class library project. I reference the client project in the service web site project and the publish web site process copies the DLL to the bin folder.
Sixto Saez
You can also get the client code from the service client created by VS 2008. Just click the show all files button in solution explorer pane. The generate will in a file named reference.cs (or .vb)
Sixto Saez
Sorry, I meant the generated code will be in a file named...
Sixto Saez
Thank for the info. I gave you an upvote for the suggestions...
Michael Kniskern
Thanks!! Glad I was to help a bit.
Sixto Saez
+1  A: 

@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://&lt;service_url&gt; /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.

Michael Kniskern