I have a WCF Service with my contracts and everything working well, and I wanted to reference on the WebSite project, but the bindinds nodes are not being created inside the Web.Config.
It should be something like:
<system.ServiceModel>
<services/>
<bindings/>
</system.ServiceModel>
But not even the <system.ServiceModel> is created
I'm using Visual Studio 2008, and I've already rebooted it, but still didn't work.
UPDATE: Found the solution in another question - Could not find default endpoint element
Related
I have a old style .NET Web Service running in IIS correctly on my local machine:
http://localhost/MyService/MyService/Service1.asmx
I added a Web Reference and set it's property to dynamic so that I could simply change the URL in the Web.config file. Prior to deploying to staging server, I configured it thus:
<client>
<endpoint address="http://staging.myserver.net/WSTest/WSTest/Service1.asmx"
binding="basicHttpBinding" bindingConfiguration="Service1Soap"
contract="ServiceReference1.Service1Soap" name="Service1Soap" />
</client>
I can access it on the server like this and it works:
http://staging.myserver.net/MyService/service1.asmx
However, I need it to resolve like the following as this is how external clients are accessing it:
http://staging.myserver.net/MyService/MyService/service1.asmx
I can see nothing wrong with the IIS configuration settings on my staging server. Am I missing something?
Generally speaking, you are free to set up applications under a website, even in nested way.
Website
|
--Application MyService
|
--Application MyService (here you host the .asmx)
Like you discovered, it is very easy to achieve.
However, there are a few red flags,
.asmx is too old, and most people upgrade to REST/Graph based web API.
Nested applications are still rare (or unnecessary). In most cases you should aim at short URLs. But since it is your external users who demand such URL pattern, you might not have a way to convince them.
I've been trying to debug this ASP.NET cloud project over LAN, because we need it for testing at work. I have done plenty of research on the subject, but I simply cannot get it to work as expected. I think I have narrowed the problem down to being that, the project is a cloud service project.
If I create a new ASP.NET MVC project, without the cloud service, it works just fine, when editing the projects bindings, plus turning off the firewall of course. If I then do the same procedure, but with a cloud service project, with the asp.net mvc as the web role, I get "connection refused" when trying to access it over LAN.
Does anyone have any idea what's going on and/or how to solve it?
Bindings:
<bindings>
<binding protocol="http" bindingInformation="*:5807:localhost" />
<binding protocol="http" bindingInformation="*:5807:*" />
</bindings>
I spent almost a full day at work with exactly the same issue.
It finally started to work after I reïnstalled IIS express.
Uninstall at Programs and Features
Download the Microsoft Web Platform Installer found at link below:
http://www.microsoft.com/web/downloads/platform.aspx
search for IIS express, and install it.
After that, it worked like a charm for me. I hope it works for you as well, because I wasted way too much time on this problem...
I know how to give service reference in Visual studio. Now I'm going to deploy the code in IIS server. there how to give Web reference (i.e Url of web service . Can any one help me.
In system 1 (Web application with web service) . system 2 (web application, web service has to fetched from system1). I can execute it in VS2008 because i can easily give service reference to system2 web application..
You don't need to add the reference again when deploying, but you may wish to change the address of the service, security information, quotas, timeouts, etc. All of this is configurable.
Web/service reference information is stored in .Net configuration files (e.g. app.config and web.config). When you deploy, you can change those values as needed to point to the correct location.
Example
Note the address attribute. This can be changed to the address where your endpoint resides.
<system.serviceModel>
<client>
<endpoint
address="http://localhost/SampleServer/PersonService.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_PersonService"
contract="People.PersonService" name="BasicHttpBinding_PersonService" />
</client>
</system.serviceModel>
I am trying to make AspNetComet.zip work on IIS7
(a simple comet chat implementation) Here is a portion of my web.config.
<system.web>
<httpHandlers>
<add verb="POST" path="DefaultChannel.ashx" type="Server.Channels.DefaultChannelHandler, Server"/>
</httpHandlers>
</system.web>
<system.webServer>
<handlers>
<add name="DefaultChannelHandler" verb="POST" path="DefaultChannel.ashx" type="Server.Channels.DefaultChannelHandler, Server"/>
</handlers>
</system.webServer>
When I publish the website on my localhost IIS7 I receive an error:
POST http://localhost/DefaultChannel.ashx 500 Internal Server Error
Could not load type 'Server.Channels.DefaultChannelHandler
The target framework of this project is .Net 2.0 I tried the Classic and Integrated Mode application pool for .Net 2.0 with no luck. I also tried converting the project to 4.0 and tried the Classic and Integrated Mode application pool for .Net 4.0 with no luck. I also tried adding the managed handler through IIS Manager's Handler Mappings.
If you have time please download the source (184kb) to reproduce the problem on your own machine. The zip contains a VS2010 solution (.Net 2.0). You could also try to convert this to .Net 4.0
I am using Windows 7 anyway if that matters. If you need more details, please drop your comments below. This is working fine by the way on my webdev server.
NOTE: I created a version of this question here as I believe it suits SO better (based on the tags and user base) than what I posted on SF https://serverfault.com/questions/245241/ashx-cannot-find-type-error-on-iis7-no-problems-on-webdev-server
This is an example chat code of AspNetComet from methodworx. When deploying it to your local development environment. I would assume that you don't have your own domain thus you will create a web application underneath the Default Website. That makes http://localhost/DefaultChannel.ashx and invalid path.
You then have to append the directory name of web application similar to this. http://localhost/WebApplicationName/DefaultChannel.ashx . On the other hand AspNetComet will encounter another error something like comet client does not exist.
I have resolved this by converting the service reference .svc to a .asmx web service.
My environment is Visual Studio 2005. My specific problem is that I want to define TRACE.
I have a Web Site Project that send trace messages when run out of the ASP.NET Development Server thanks to defining it in the system.codedom element of the web.config.
When I deploy to IIS, I do so via a web deployment project. So the site is precompiled. Naturally, these entries serve no purpose on a compiled website.
My question is how do I define TRACE in the web deployment project?
The visual Studio IDE does not allow you to set compile time constants in web deployment projects as far as I can tell. However, since a .wdproj file is just an msbuild file, you can edit it with a text editor. You need to add a element to the sections as illustrated in the screen shot in the provided link.
I cannot change the link to an image since new users apparently can't add images:
Annotated screenshot of .wdproj in a text editor http://img140.imageshack.us/img140/1719/deploymentproject.png
There is no equivalent to #defines in C#. That said, it sounds like you want to use conditional tracing, which is easily accomplished. If you have diagnostic code throughout your project but want to define it, use the built in trace functionality, for example
System.Diagnostics.Trace.WriteLine("Some debug output");
Then, in your webconfig, you can configure it on/off using
<configuration>
<system.web>
<trace enabled="true" requestLimit="40" localOnly="false"/>
</system.web>
</configuration>
More info here