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>
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.
Newbie question. In vs2010 (.net 4.0), I used the WCF Service Application template to create a Web Application. This was then published using Web Deploy to IIS 7 residing on the same box as my client application.
How can the WCF Service Application be debugged?
I have tried this:
Set a breakpoint in the Service1.svc.cs code.
Recompile all with a debug configuration. Build target is to bin\
Publish the WCF Service Application project to the local IIS7 website.
Start the client application which calls the IIS7 WebSite.
Start a second instance of VS2010 in administrative mode and Attach to process w3wp.exe.
return to the first instance of vs and execute the method that has the breakpoint set.
Bringing back up the second instance of vs (the one that is attached), only shows "Disassembly cannot be displayed in run mode".
What did I miss? Is there a better way?
Any help or suggestions would be most appreciated.
Edit #1: I added debugging to the web.config, as:
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Still no luck??
Edit #2: In running the web service application project directly in its own instance of vs, I get
"The Web project "WCFServiceApplication0" is currently configured to
use the URL "http:/localhost:8999/WCFServiceApplication0". The Web server has this URL mapped to a different folder "C:\Nova5\WCFServiceApplication0_deploy". Would you like to remap this URL to point to the Web project's folder?"
How should this be answered? And how did a *_deploy folder get made? Thank you for your consideration.
You can directly debug your WCF service.
VS(Run as Adminstrator) -> Open the Wcf Project -> Properties -> Web
-> Point to the VirtualDirectory of IIS.
Then Right click the Svc.cs -> Debug as New instance.
If you have mulitiple hostable Projects in Solution Like 1 Web and 1 Wcf, then set Multiple StartUp Project from Solution -> Set StartUp project.
i have already a web site which is live and hosted in ORCS Web developed using asp.net form project type. now i am planning to develop a wcf service which will be stored in a new folder of my existing website. we will use wcf service for uploading file from client machine to our web server. client can be any other .net based web apps or .net based win apps. i never work with wcf in production environment. so i want to know can i create that wcf service which will be stored in a new folder of my web site or do i need to host that wcf service separately.
if i can store the wcf service in my existing web site then how to deploy it? if i copy the dll file of my site and svc in our web server after development and testing then it would be sufficient or not for creating proxy from client side. actually any how i have to create wcf service in my site. i can not deploy the wcf service separately out of my website. so guide me how to deploy and what are the files i need to copy to my web server because first time i will be going to do this. thanks
You can add wcf service to existing asp.net application.
Open solution explorer right click on asp.net app project and select "Add" -> "New Item" and then select "WCF Service".
VS will modify your web.config by adding something similar to this, wcf server configuration:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
And now about deploying solution. It's never a good idea to do partial deploy. Please read one of my posts about this subject What files to upload when making a change in a webpage
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
Trying to deploy a wcf rest service inside of an asp.net web application. Works wonderfully when deploying to test server in visual studio, however when i deploy to iis 6 I get nothing. It is as if my service is not there at all.
here is my web config under system.service model:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
and im registering a route in the global.cs
routes.Add(new ServiceRoute("Service", new WebServiceHostFactory3(), typeof(WcfJQueryService)));
my web service class is decorated with:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
I am using windows authentication if that matters in this case...
Any ideas??
Got this to work via the instructions in this article...
http://hackprogrammer.blogspot.com/2009/01/installing-wcf-on-iis6.html
running aspnet_regiis -i for .net4.0 got me up and running