AJAX :: Have A Webservice Which Refered Into Project?
Feb 18, 2011
I have a webservice which i refered into my asp.net project.i instaniated the webservice and when i am calling the webservice method i am getting the following error There was a problem retrieving the data. System.Web.Services.Protocols.SoapException: Server was unable to process request.
i have an project with name called(dbservice layer) which is in path: d:webserviceDBService. here i have an webservice which connects to DB and returns an object of an class.
once i added an reference here i get an url:http://localhost:2371/Jobs.svc
now i have another project name (UILayer) whic is in path: E:SchoolUILayer i added an service reference here with url as http://localhost:2371/Jobs.svc but i get an messgae telling service is unable why is that happening.
if both my webserivce layer and ui layer are in same project. then i able to use the webserive in the ui layer. and get the required output
so i wanted to know is there any way we can acesss the webserive from one project to another project
I have two solutions in .net (solution "A" and solution "B") which both have web services. I want to call a web service method in solution "B" from solution "A". I am very new to C#.
I'm trying to call an asp.net webservice from the same project it's in:
[MethodImpl(MethodImplOptions.Synchronized)] public static void OnFileCreated(object source, FileSystemEventArgs e) { trackdata_analyse rWebAnalyse = new trackdata_analyse(); rWebAnalyse.Analyse(@"pending" + e.Name, "YOUNIVATE"); }
However i always get the following "HttpContext is not available. This class can only be used in the context of an ASP.NET request." when calling Server.MapPath from the webservice:
[WebMethod] public int Analyse(string fileName, string PARSING_MODULE){ int nRecords; TrackSession rTrackSession = new TrackSession() ; string filePath = Server.MapPath(@"..data") + fileName;
Do i have to add the WebReference instead, though the webservice is in the same project?
But when I refer to that webservice (as shown below), I get error saying: "The type or namespace name 'MyServices' could not be found (are you missing a using directive or an assembly reference?)"
What should I do to correct this error?
Current Solution of Adding Service Reference still gives me that error.
I've created class library project and added service reference to webservice. When i try to use webservice object am not able to access webservice methods.
myservice proxy=new myservice(); proxy.( no methods are coming)?
When I turn on Code Coverage in my test settings, on a project that references the Unity DI container I get the following error:
Cannot initialize the ASP.NET project'{Project Name}'.
The event log specifies the following reason:
Could not load file or assembly 'Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified.
I am new to ASP.NET (2 months) and my very first assignment is to create a website for a municipality. Purchasing as much reading material as possible, I got started and after some time, I have a decent website (coded in C#) that is ready to be internally tested on the departmental webserver. The Web server is running IIS 7 and the pages were developed with Visual Studio 2010. On the main default page, I wanted to implement a slide show using the AJAXControlToolkit which I installed. I watched the ASP.net tutorial [URL] and literally coded my slide show verbatim. I try to launch my slideshow within my default.aspx page and absolutely nothing happens. The steps that I took are
1. Created a webservice (SlidesService.asmx) which generated a code behind file (SlidesService.cs).
2. I created the web method GetSlides() containing a 22 element array which I place in the code behind file.
3. Implement the ToolkitScriptManager establishing my image control.
4. Defined my Previous, Play and Next buttons.
5. Implemented my SlideShowExtender providing my SlideShowServicePath and SlideShowServiceMethod.
Assumptions: In doing all of the above, I noticed that the SlidesService.asmx file needs no code (as I placed all code within the codebehind file). The SlidesService.cs code behind file should reside in the App_Code folder whereas the the SlidesService.asmx file can remain in the root folder. No Button e.g Button_Click needs to be attached to the code behind source file. If I have conveyed my steps properly, can anyone shed some light on why when clicking the play button, nothing happens? Code is listed below.
I am planning to use a Javascript call to a WebService to retrieve data from the database. At the moment I am using Ajax to do this. But since the Ajax is slowing down the performance of my application. I have read in some article that even though Ajax only refreshes the Update panel contents, Ajax does a full round trip to the server. What I need to know is how can I populate a Grid from data coming from a WebService via a Javascript call.
i have application with 2 cascading dropdownlists that got populated using web service, when a value was picked in the first one the second filled with values, now when the second one got selected i want to poulate listview with images links.
I am working on an application just like any fast food restaurant uses for example McDonalds.
Basically, application consists of three parts.
1) Web Application # 1 to take orders (Used by the clerk(s))
2) Web Application # 2 to process orders (used by the chef back in the kitchen)
3) WebService returns new orders (with PENDING status) to Web Application # 2.
Write now, Application # 1 adds new orders to the database. Application # 2 calls the WebService to get new ordes by REFRESSHING the page again and again. Refreshing the page over and over again is the problem.
I want the WebService to automatically send new data (oredrs with PENDING status) to Web Application # 2 whenever Application #1 add new order.
Application # 1 can call WebService (sending true flag) to let it konw that something has been added so the WebService can broadcast new date to Application # 2
Here is the flow which I am trying to achieve
Application # 1 (Takes new Order) Application # 1 then call WebService (sending true)
WebService (if true is received), send new data to WebApplication # 2, cause postback on Applicatin # 2 automatically
For Example just imagine when you walk in McDonalds
Clerk takes your order -> New order is automatically send to the Kitchen (to process order)
Here is the breakdown
Application # 1 = Clerk taking order WebService = Mechanism which is sending new order to Kitchen Application # 2 = Monitor in the Kitchen receiving orders.
Iam new to webservices,Till now I did not use web service.Anybody can you give a real time example for webservice.Please it will be very useful for me.
This has totally spoiled my .net 4 vs2010 realease day happiness. Running Cascading dropdowns using 'webservice' asmx method. Everything worked on .3.5 and i solved the running 'code In page' method with this post. Method error 500 [URL] Thought I was sorted but seems the rules are totaly different for the 'webservice method'. For example where did ToolkitScriptManager come from Ive been using ScriptManager for years. Anyway below is the Webservice and Page code. Ive looked at and tried everything of the forum but all of it is pre .4. This is demo code, the real version has 3 dependant dropdowns and the lookups are used several times so it HAS to be a webservice. My current theroies are:
1. Permissions- dosent makes sense. 2. Something missing in web.config to enable webservices. 3. Something to do with placement of 'System.Web.Script.Services.ScriptService()>'
After watching [URL] learning guide in accessing Web Service from JavaScript[/url] I was doing the same thing in order to test it. And found out that in my JavaScript I don't have any WebService in my IntelliSense. Such thing happens if I create WebService and WebSite either in one common solution or in the different.
I have am trying to implement a simple AutoComplete function yet i am having difficulty. It looks like the AutoComplete control is not even calling the method (webservice). If i load the webservice from the browser, i can see my Method, click on it, enter in the prefix, click on Invoke and it returns a SQL STRING. Below is the string the webservice returns.
I would like to use the ajax slideshow extender and getting the Image Url stored in a databaseso far my webserivice look like this..but I think im making a mistake somewhere..its not working
<WebMethod()> _ Public Function GetSlides() As AjaxControlToolkit.Slide() Dim Connection As SqlConnection
Now i dont understand why my Autoextender is not call the webservice. I have tried callin the webservice from button click event...it works but not using AutoExtender..
I have a textbox with the autocompleteextender in VS2010 that is referencing a webservice. However, nothing I seem to do makes this work as no values are returned when I begin typing in the textbox. When I view the webservice in my browser and invoke it, it returns values so I know that my webservice works. Code below.
Can I use the latest AJAX Control Toolkit on a .net 2.0 project which will be deployed to a server with framework 2.0 only? If not, where can I download the latest AJAX Control Toolkit for framework 2.0?
I need to pass a customer id to get some data back for a customer from a webservice. I can't figure out how to get to the webservice, I have a breakpoint set in the webmethod but it's not being hit and the alert box is not popping up either. For a test I am just trying to show some value from the returned data in an alert box. Note I am just hard coding the customer id of 1001. The webmethod takes a parameter of string customerid.
[Code]....
Does some one know what's missing or how to debug this issue?
I'm calling a webservice using jQuery with .ajaxHere are the data parameters for the call:
var parameters = "{'Titre':'" + Titre + "','Description':'" + Description + "','Contact':'" + Contact + "','VilleId':'" + VilleId + "','QuartierId':'" + QuartierId + "','UserId':'" + UserId + "'}"; It works fine. But when parameters Description or Titre contain the ' character , no call!!!
Does anyone have an idea how can i make it work even with apostrophe character in Titre and/or Description?