When I added service -> web service. The VS2008 added a App_WebReferences folder without a .asmx file. I see a .discomap file.
When I use the cascading drop down ajax control, it is looking for .asmx in the service path. Am I doing it wrong? I remember the early edition of Visual Studio added a .asmx file when you added a outside webservice reference.
EDIT:
I don't think I'm clear on my question. I have a ASP.net Webservice application that is setup on localhost/service. I want to reference to that service in my asp.net website. I first added the project to the service in the soultion add existing project then on my website i added the web reference via localhost/service. It now have a folder App_WebReferences and the service folder along with service.discomap, service.disco and service.wsdl
when i try to use the cascading drop down extension. the service path is looking for .asmx file so how do i setup the service path for the ajax extension?
If the dropdown needs to call the web service, just give it the URL of the web service (ex: http://localhost/mywebservice/service1.asmx). I believe you'll also need to give it the name of the web method to call.
You won't need to add a web reference to your project unless you plan to call the web service manually.
You added a reference to an external service. You'll want to create a new web service by right clicking on your project, then Add New Item and selecting Web Service.
Also note that if you make a folder, say, WebServices, and add the asmx there, it'll place the .cs file in App_Code. If you have a web application project, I'm not sure where it would put it since there is no App_Code.
Related
I developed a rest api using ASP.net web api. When I deploy this rest api on iis, I need to create it as a web application under an asp.net web site. When I was deploying the rest api as a new web site in iis, then things worked fine. I was using the following Route api/{controller}/{id}.
When I created the rest api as a web application underneath asp.net web site project, I named the web application as api. I can't access the api methods now. Can someone point what I do wrong?
WebApi is based on global.asax and web.config configurations and you can't have 2 of these files inside in the same application. In the scenario you described, it sounds like you need to create a "Virtual Directory" in IIS for the second application instead of making just a "Sub Folder".
The Virtual Directory will allow you to declare a new web.config and global.asax where you set the new routings and configurations method for your second application.
For a full walkthrough on how you can perform this please refer to this site:
http://msdn.microsoft.com/en-us/library/vstudio/bb763173(v=vs.100).aspx
I have deployed an ASP.net enabled WCF service but the javascript returned by the service is outdated.
Do I have to manually refresh it?
Turns out it is not allowed to move the cs files outside to App_Code folder
I've got a WCF (RESTful) web service within an ASP.NET website project. The service resides at /WebServices/Registration.svc. I'm trying to create a custom BasicAuthenticationModule httpModule to handle Basic Auth as explained at https://stackoverflow.com/a/4729555/291323, but the module is being used for my entire website, which I do not want.
I tried using the tag to define the module for ONLY the service, but couldn't get it to work. I tried setting the path to both "WebServices/Registration.svc" as well as just "WebServices".
Is there a better way to register an httpModule to affect ONLY a WCF webservice within a website project?
TIA for any assistance!
Suppose I created a custom web application that consists of:
several assembly DLLs: web app, business logic, data services
multiple aspx pages and ascx custom controls that use them
custom configuration section
custom HTTP module
More or less the usual stuff.
I would like to deploy it to a particular sharepoint site under a certain subfolder. So if I access my sharepoint site via http://myserver:90/ (because I'm not using sites/some_site) I'd like my application to be available under http://myserver:90/webapp
I could manually add a virtual folder (not application because I would need to access some Sharepoint site's data) to my sharepoint site in IIS and manually edit site's web.config file to register my HTTP module and add my custom configuration section as well either putting my DLLs into GAC or put them in the _app_bin (so I don't have problems with CAS), but I don't think that's a good thing to do, because this web application may get deployed in an environment where this shouldn't/couldn't be possible.
So I figured I could build a WSP using Visual Studio 2010 and deploy it that way. But I don't have enough experience doing that.
I created a new sharepoint 2010 project. Is there a way I could add all non-executable application files (aspx, ascx) at once? I've seen the advanced tab of the WSP package where I can add my DLLs either to bin folder or GAC. I don't know whether I would also have to add any safe control and register certain classes?
So I suppose I need some pretty detailed and explanatory guidance here.
The only real way to do this would be to use the layouts folder to deploy your application via the wsp. This will let you depot any files that you would normally deploy with a.web application.
There are couple of problems however. The URL for your application will be http://SharePoint/somesite/_layouts/yourapp
This is a blessing and a curse. Your urls will be ugly but they will work under every SharePoint site. If your application depends on SharePoint context to function, that context will automatically be available based on the requesting URL.
To add a layouts folder under your share point project right click on the project and add a mapped folder to layouts. I would also recommend adding a sub folder under layouts for your application so that your application files don't conflict with the default files directly in the layouts folder.
For the http module, or any web.config modifications, you can use the spwebconfigmodification class.
Heres a walkthru: http://sharepointsolutions.blogspot.com/2006/12/using-spwebconfigmodificat_116736917110571614.html
I have a solution with a number of projects in..
One of these projects is a web application, another is a web service.
The web app references the web service, and uses the methods in there.
In production, the web application will be hosted on one server, while the xml web service will be on another.
My question is, how do i deploy this?
I've "published" the application to the correct server, however what do i do with the xml web service? and how can i configure my web application to point to the other server, rather than try and use localhost....
You generally won't leave your web service proxy classes with their default URL in production code. You can configure the production web service url in your web.config class and then have something like
MyWebService svc = new MyWebService();
svc.Url = WebConfigurationManager.AppSettings["MyWebService"];
Something along those lines should get you what you need.
When you add the proxy to you web application, you can set it to be dynamic url. This will create a config file entry that can be set during your deployment. Click on the Web Reference in the Solution Explorer, change the URL Behavior from Static to Dynamic from properties. An app.config file will be created with a key.