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 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'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?
I have to call a webservice published in the same website the caller aspx is. When I try to "Add a Web Reference" the editor does not show the webservice methods from the generated namespace. Do I have to use the "Add Web Reference" or is there another way because the webservice is in the same website? Visual Studio 2005, C#
I have a web app that makes a call to a webservice, and it is causing a ThreadAbortException. Why is this? This does not happen when calling the webservice in a windows form application.
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.
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)?
I'm doing a project in asp.net with a web services. My web services and my asp.net project is separate and my asp.net projet have a reference of my web services. i'm using visual studio 2008 framework 3.5 and my service web is in vb.net. i want to call the web methods of my web services in javascript my script manager is declared
service1 is the class of my Webservice and i call the function test with my button <input name="btnRecherche" class="btnRechercher" type="button" value="Rechercher un emplacement" onclick="test()" /> the problem is : JavaScript say Service1 is not defined but why .... What's the problem ? I've checked many forums and videos every body did it sorry for the french variable
I need to make a call to a json webservice from C# Asp.net. The service returns a json object and the json data that the webservice wants look like this:
"data" : "my data"
This is what I've come up with but I can't understand how I add the data to my request and send it and then parse the json data that I get back.
string data = "test"; Uri address = new Uri("http://localhost/Service.svc/json"); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address); request.Method = "POST"; request.ContentType = "application/json; charset=utf-8"; string postData = "{"data":"" + data + ""}";
How can I add my json data to my request and then parse the response?
Can I call a webservice from a Controller Action in ASP.Net MVC?
public ActionResult Index() { PersonObject person = new Person("Sam"); //Call a webservice which is located in the same app under /Services/General.asmx/WebMethod and pass it person }
I have MVC application (applies to non MVC as well) where a user is posting in data. I need to take this data, send it off to two seperate end points (one using a WebRequest form POST and one using a Web Service), parse the result, and send the result back to the original user.
The issue at hand is that both end points take about 20-30 seconds to respond (response is a string) which means that I should probably execute these two calls asynchronously. At the same time I want to wait to respond to the original user until I get both results back. I am guessing I might have to use some sort of object lock so the response does not get sent back before the two calls are complete?
Based on the responses I decided to go with async controllers since I am already working with a MVC application.
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've enhanced my web service with a new method. If I open a browser and type the url of the service, I get a list of the methods including the new one, so that looks okay.
I have a snippet of code which I paste to a Firebug console to test the method, and I am getting a 500 internal server error. If I use the same snippet of code and modify it to test one of the other methods, that works fine.
What I can look at to figure out what is wrong with this new method? The other weird thing is if I try to run the URL on the server it says The test form is only available for requests from the local machine. But I am on the local machine. So I don't know if something is screwed up there, too, or it's the same cause or what.
I know there's tons of advice on the Internet regarding server 500 errors but this is unique in that my web service is working except for the new procedure.
I think I will write another new procedure that's simple (like Hello World) and see if I can call that. This new method returns a list of objects but so does one of the older methods, so I don't know what would be unusual there
all My web app is calling webservice which resides in same virtuall directory as web app . In this scenario i have a javascript function like this which works perfectly.
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?
I've created a small class library to asynchronously call a WebService(Fire and Forget. I don't need the result).In a Windows Form application, the XXXAsync() method works fine. But, in a Web Application, the process is locked until the XXXCompleted event is fire.My problem is: I tried to create a Delegate and use the Begin/EndInvoke to call the XXXAsync() method. It worked fine, but, the w3wp process seems to be consuming a huge amount of memory. I'm calling the EndInvoke method properly. Invoking the GC.Collect did not free any memory
I have created web service and deployed on server after creating proxy server ..........
when i browse the URL used in proxy server from different computer on same network, it works fine..... but when i browse the same URL on computer on different network, it wont work.....
I have a webservice "DataService.asmx" which I am using for AJAX calls for insert, update, delete and some other tasks. All the pages are calling webservice smoothly but this new page I added and calling my webservice using the same ajax method not working. Strange thing is that neither its going on SUCCESS nor FAILURE...and put a breakpoint on my webservice but its not going into the webservice...plz help as its been 6 hours now figuring what the problem is..here is the code.
I have a mvc controller that communicates with a we service for user authentication, when user clicks login button, onclick event makes a call to javascript function using ajax and it makes a call to an action in server.The problem is when a use fiddler tool shows ajax call to the controller and also web service call, web service is called from controller never javascrit, how I can protect visibility of web service calling?, using web forms with the same scenario never shows a web service call.
My javascript code is calling a asp.net webservice, so i have a call to the webservice something like this:MyWebservice.GetData(param, ResponseReceived, ResponseTimeOut, ResponseError);When the webservice returns data, ResponseReceived method is called.However sometimes the user might navigate to another url before the webservice call actually returns, in such a scenario FireFox throws an Error saying 'An error occured oricessubg the request. The server method GetData failed'So my question is how can i kill the async call when the user navigates to another page or makes another request to the webservice? I know in a normal XMLHttpRequest i could have called Abort method, but not sure how to make it work with the above webservice proxy.