.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

How to access webservice using Jquery

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :ASP.Net
Hi to all   I have some queries regarding accessing web service deploy on another server.  I have two project both on same machin under same solution.One is my webservice and another inculde my webproject that access that webservice using jquery .I am using flexigrid control to populate my data.it is working fine when i am trying to use the webservice on my machin under same solution but when i try to use webservice reside on another machin it not working for me.This is my aspx page<script type="text/javascript"> $(document).ready(function() { var SessionUserID = ('<%=Session["UserId"].ToString()%>').val; var myDate = new Date(); var prettyDate = myDate.getDate() + '/' + (myDate.getMonth() + 1) + '/' + myDate.getFullYear(); $("#<%= txtAuctionDate.ClientID %>").val(prettyDate); $("#<%=txthiddenDate.ClientID %>").val(prettyDate); $("#flex1").flexigrid ( { url: 'http://localhost:2158/TWWebService.asmx/getBuyerDealBook', dataType: 'xml', colModel: [ { display: 'LotNo', name: 'LotNo ', width: 120, sortable: true, align: 'left', hide: false }, { display: 'DealNo', name: '

View Complete Post

More Related Resource Links

Writing Data to database with jQuery Forms, ASMX Webservice, & JSON - help!



Can someone point me in the right direction on how to submit data from a jQuery form to a ASMX webservice? I have gotten everything on the form ready to be submitted to the database and now I am stuck on how to send it over using $.ajax(). Everything I have read tells me how to get data from a webservice and display it with jQuery, but not the other direction nor how to access the json data within the within the webservice service(similar to a Request.Form approach with ASP.NET forms).

In other words: 

1. What do I need to do to my webservice to make sure it can receive data from the jQuery form. 

2. What do I need to do in jQuery to receive an acknowledgement the save on the server side was successful. 

I can explain more if need be, but if there is a comprehensive tutorial on not only reading, but also WRITING data with jQuery, JSON, etc. I would love to get pointed in that direction. 

Calling a webservice in MVC using jquery works on dev box not prod box


I have a webservice that is part of the MVC project.  I am using VS 2010 MVC 2.0 on Windows 7.  When I run the web application locally the webservice call works flawlessly, however on the prod box using  2008 upgraded with asp.net 4.0 it fails.

I get an error "The controller for path '/services/traxservices.aspx/upDateCustomer' was not found or does not implement IController. "

Is there some type of issue with the settings in the global.ascx or in IIS that I am missing?


Any help would be appreciated.

Access resource file using webservice


Hi I need to access a resource file in a web application, using a WCF web service.

The webservice will be hosted in the same domain as the web application, but its business logic is in another assembly.

How can I retrieve the correct resouce file (according to the current culture) from the business layer, and returning a List of KeyValue pair from it?

Thank you.

Data access from Remote system throwgh webservice

Hi, i wrote the webservice and configured in our server and having access the service through the browser from another system also working fine, But i am trying to access the service through in my application creating the proxy and accessing methods of the webservice, but it can't get the data from  the remote sqlserver through the webservice.    this is for my connection string  in  web config:   <add key="ConnectionString" value="server=EVEREST;initial catalog=MRMv1;uid=sa;pwd=kk"/>   the following the error was shown to me: Server was unable to process request. ---> Login failed for user 'sa' but i can login to sqlserver using 'sa' user in the remote server. how can i get the data from the remote server.        can you please guide to me. thanks and regards brite

jquery webservice with parameter

how to call web service with jquery in asp.net with param valuethanks in advance

jQuery / javascript calling a webservice


I've tried a bunch of different examples and still can't get this to work.

I have a jQuery GalleryView control I'm using and I simply want to log impressions.  I set up a webservice that works, but I can't figure out how to get it to work in javascript.  I have verified that the webservice is working as expected.

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptServ

Securing Asp.net Webservice from anonymous access.


Hello friends,

     Actually I am working on a project in which I have several webservices(.asmx pages) in which I have some webmethods. Now what I need to do is, securing the webmethods as well as the .asmx pages from anonymous access. Only application can use those methods or you can say those webservices.

Please give me some ideas or solutions or some sort of techniques by which I can be able to secure them from anonymous access.

A very Fast reply is awaited.




Unable to get to the webservice using ajax POST jQuery



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.

//Webmethod code:

        public customer fetchcustomer(string customerid)
            customerDL custDL = new customerDL();
            return custDL.getData(customerid);



//jQuery code:
   $(document).ready(function() {

            type: "POST",
            contentType: "application/json; charset=utf-8",

Help with access external webservice



I'm trying to connect to a webservice  but my experiens of webservice i limited

            Dim strLicensPlate As String = Trim(LicensPlate).ToUpper()
            Client.SoapVersion = Services.Protocols.SoapProtocolVersion.Soap12

            Dim info As New carWorkOrderInfo
            Dim infoRequest As New CarWorkOrderInfoRequest()
            Dim body As New RequestCarBody()

            body.licensePlateNumber = strLicensPlate
            body.limit = 1

            Dim Header As New RequestHeader

            Header.userName = ConfigurationManager.AppSettings("User")
            Header.password = ConfigurationManager.AppSettings("Pass")

            infoRequest.requestCarBody = body
            infoRequest.requestHeader = Header
            info.request = infoRequest

            Dim CarValues As carWorkOrderInfoResponsePart = Client.carWorkOrderInfo(info)

Dim strAreaID As String = CarValues.response.carWorkOrderInfoResult

The values that I would like to get

Sync local db access 2007 to webservice having sqlserver 2005



   From last few days i am struggling to auto sync from windows application developed in c# having connection with MS ACCESS 2007(.accdb) database, and having sqlserver 2005 in webservice.

 The problem is i cannot syncronize the access 2007 to sqlserver 2005, if any one have any idea about this plz help me out.


Unable to access the webservice developed with wcf



i have developed a webservice using wcf. and i deployed on IIS 7.

when i try to browse the svc file(http://localhost/service1.svc)  it is opening .

But when i browse with ( http://localhost/service1.svc ?wsdl ) it is saying page canot be diplayed.

i didnot understand what is the problem. please help me in this.


Restrict public access to webservice


I have this Internet web service page(webservice.asmx) being consumed jquery ajax call.

And I am hoping to restrict public request to this webservice other than request from local pages (aspx or jquery ajax call).

The web service checks for form-authentication before it gets executed but I just don't feel comfortable the .asmx page and list of services are viewable.

So users can't just type www.mysite.com/webservice.asmx to access my webservice. 

I'd appreciate any advice about securing web service.

Access Class in a Webservice



I add a web reference and in this webservice their is a class inside the Reference.vb. How do I access this class inside the webservice?


Trying to upgrade MSXML2 SOAP code to WCF with out access to the Webservice.


Hi I am currently investigating how I can change the following code into WCF, But all the examples I have seen require a live web service. To anybodies knowledge is there a way to generate WCF code without access to the Web service the developer is generating code against?

Also due to the nature of the web service I am calling it uses specific soap calls for each of it RPC services. Please see below the code which currently uses MSXML2 which I am currently trying to upgrade.

Imports System.Xml.Serialization

Imports System.Linq

Imports System.Xml



jQuery Autocomplete with WebService



I am using the jQuery autocomplete. I get the data bu a WebService. I pretty sure that the WebService return the good value (I checked it with a breakpoint and with firebug's console).

This is the javascript code:

$(document).ready(function() {
        type: "POST",
        url: "WebService.asmx/GetClientFromDb",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        sucess: function(data) {
                source: data,
                minLength: 0
        error: function() {
            alert("Error in WebService");

The alert box is not fired so I guess the WebService call is a sucess. If someone see my mistake, let me know



Cannot access Sharepoint List using Lists.asmx webservice

var a = new ActiveXObject("Microsoft.XMLHTTP");
a.setRequestHeader("Content-Type", "text/xml;charset=utf-8");
a.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetListItems");

var d = "<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:tns='http://schemas.microsoft.com/sharepoint/soap/'><soap:Body><tns:GetListItems><tns:listName>

Access business logic through a webservice


This should be fairly straightforward, but there seems to be nothing on how to do this.  So far  I've just created wrapper WebMethods and that accessed most of my methods fine, except for the one that returns an object that inherits icollection.  The error returned says to create a default accessor for the class (I don't want to touch the existing business classes, as they are being used elsewhere.)  But, I'm also sure theres many more problems along the way.  So, is there complete documentation to do this?  Or a proper tool to generate a webservice layer?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend