Runtime Error with referenced WCF Service - asp.net

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

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: 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.

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?

Related

IIS-based Web Service

I have created an ASP.NET Web Application in Visual Studio Community 2019. I am trying to deploy a web service in IIS but I keep getting the 404 Not Found error. The application pool in the IIS manager looks like this
I create a connection
and then publish the application but I get this error
The .NET Framework is 4.7.2
What did I do wrong?
As per your screen shot application is hosted with virtual directory Webapp.
URL Should be http://Localhost/webapp/webservice1.asmx
First change url to http://Localhost/webapp/webservice1.asmx. Then check Mapping to an ASMX service using routing in ASP.NET MVC for solving the mapping problem.
I suggest publishing the site to the folder. Then create a new site in IIS Manager and show its physical path to that folder. Give your site some path like localhost:3600. Then when you open that path in the browser and search http://localhost:3600/WebService1.asmx, it will definitely work(at least it worked for me)

Unable to run migrated web application in VS2013

I have an ASP.Net web application developed in Visual Studio 2008 (.Net 3.5). I have copied this solution to another root folder (both on my Win7 64b machine) and upgraded the copy to VS2013 (Professional) and .Net451, but when I try to debug the web app in VS2013 I get an Access Denied error ("Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server"). I don't have this issue runing the original from VS2008 on the same machine.
Apart from the changes mentioned above the two are a straight code copy.
In VS2008 the project Web properties are: Use Visual Studio Development Server, auto-assign port, Virtual path = /
In VS2013 the project Web properties are: Server=IIS Express, Project URL=http://localhost:63064/ (and I have clicked on Create Virtual Directory)
I can see this must be some sort of security issue, but what extra needs to be done to get a VS2008 web app, upgraded to VS2013, to run within the VS2013 IDE?
Postscript: If I start the web app without debugging (ctrl-F5) I get "HTTP Error 503. The service is unavailable."
It turns out that the simple solution is configure the web app properties in VS2013 to use the local webserver (IIS) instead of IISExpress, and also to run VS2013 as administrator (but this is not necessary for VS2008). So obviously it is an IIS permissions thing but IIS is common and hasn't been changed - so what has changed in VS2013 to make this necessary? I don't really want to run VS2013 as administrator if I can avoid that.

Want to Publish and deploy a web service in my local machine with out using IIS

My Web Service link:
http://localhost:55004/WCFService2/WebService.asmx
Please how to do this with out IIS.
I am using Visual studio 2012 express edition and I dont have "Publish Website" option in build.
I am new to .net and webservices...Please tell me is there any possibility to do this?
here try this one it may help
"http://ransandeep.blogspot.in/2011/03/publish-webservice-locally-without-iis.html"
Web services cannot be deployed without the use of hosting applications such as IIS.
However if you are using WCF, It can be hosted in following ways.
Self Host
IIS hosting
Windows service
WAS
You can pick any suitable hosting method based on your requirements.
There are many tutorials available on the net that provides you with step-by-step process with graphical example regarding this.

ASP.NET MVC 4 and Web API in Azure - No HTTP resource was found

Using Visual Studio 2012, I created a simple Windows Azure Project (Cloud project) for which contains a ASP.NET MVC 4 website. I didn't change anything to the template and I simply try to deploy it using Azure Website. I imported the "publishing profile" from Windows Azure Dashboard into my project and deployed (using Visual Studio).
At the very end of the deployment process I am getting the following message: "failed to open 'http://mysite.azurewebsite.net'. Exception:Class not registered". I can only click "Ok" on that dialog. Any idea why I am seeing this message?
When I look at the Output Window, I see that the deployment succedded. I go the a Web API url and I am getting "No HTTP resource was found that matches the request URI 'http://mysite.azurewebsites.net/api/values'". What puzzle me is that I can access that same url on my local environment.
What am I missing? Thanks!
I could access using my Azure website using ASP.NET Web API. If you use default MVC4 Web API template, please access "http://[yoursite].azurewebsites.net/api/Values/".
My Environment is below.
- Visual Studio 2012
- ASP.NET MVC4
You don't need to create a cloud project to use Azure Websites. You can simply create an MVC app and then use git deploy or even FTP to push the site to Azure
Make sure that you referenced the latest version of WindowsAzure related assemblies in your project.
Microsoft.WindowsAzure.Diagnostics 2.0 (and not 1.8)
Microsoft.WindowsAzure.ServiceRuntime 2.0 (and not 1.8)

making a web service ? How to make its WSDL?

I am making a web service and I am new to web services. Please guide me how to make WSDL for my .Net web service ( it is no WCF service).
Please also guide me where I will place WSDL file, on client or server side ? where I will place WSDL file.
Thanks
MSDN : Web Services Description Language Tool (Wsdl.exe)
use Wsdl.exe utility in visual studio 2008 for web services
you must run that tool from command prompt ,
Start - > all programs -> Microsoft Visual Studio 2008 - > Visual Studio Tools -> Visual Studio 2008 Command Prompt
To generate wsdl file, you must use wsdl.exe from visual studio command prompt. But if you expect to use wsdl in your solution projects, in visual studio, you can click on project, choose add web service/service reference -> choose your service from solution or url and then VS automatically generate all file for you
Use Wsdl.exe as suggested by Pranay Rana and put it on the server.
To access web service on a client .Net side create a service reference in visual studio to get the client proxy.
It sounds like you're just using ASMX based webservices, correct?
If you want to generate a WSDL on an ASP.NET/ASMX site, you can run the web application and hit the ASMX URL with the querystring "?WSDL". So if your service name is
http://myserver/myservice.asmx
then you can hit
http://myserver/myservice.asmx?wsdl
Save the page locally and you can send it to whomever needs it. Exposing the WSDL is enabled by default, the person or company who needs to consume the WSDL can generate it by hitting the URL as well.

Resources