Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1059361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:09:35+00:00 2026-05-16T18:09:35+00:00

I have a webservice webmethod which saves the xml output to destination [WebMethod] [ScriptMethod(ResponseFormat

  • 0

I have a webservice webmethod which saves the xml output to destination

[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Xml)]
public XmlDocument GetList(
  string keyword1, string streetname, string lat, string lng, string radius)
{      
  XmlDocument xmlDoc = CreateXML( keyword1,streetname,lat,lng,radius);

  //save file to application folder which will be refferd by client application
  xmlDoc.Save(Server.MapPath("~/Block3.xml"));
  return xmldoc;       
}

I am trying to refer from client side using the following code in searchurl

function searchLocationsNear() {
  var radius = document.getElementById('radiusSelect').value;             
  var searchUrl ="http://localhost:2385/block/Block3.xml"; //reference for xml file stored in application folder

  GDownloadUrl(searchUrl, function(data) {
    var xml = GXml.parse(data);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:09:35+00:00Added an answer on May 16, 2026 at 6:09 pm

    The following is a simple example of how you might use jQuery to call the server side WebMethod from the client side. This code assumes that you are hosting the searchLocationNear(...) method in WebService1.asmx

      function searchLocationNear() {
        // Get the radius using jQuery
        var radius = $("#radiusSelect").val();
    
        // Make Ajax call using jQuery
        $.ajax({
          type: "POST",
          data: "keyword1=&streetname=&lat=&lng=&radius=" + radius,
          url: "WebService1.asmx/GetList",
          success: function (response) {
            var xml = GXml.parse(response.xml);
          },
          error: function (response) {
            alert(response.responseText);
          }
        });
      }
    

    Here $.ajax is used to make a call to the GetList web method, and the XML is extracted from the response. This works find if you are returning an XmlDocument on the server side as in your case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have webservice with one method which recieves xml as string: [WebMethod] public int
I have following webservice: [webmethod] public string MakeReservation(?? PassengersInfo)//what data type use for PassengerInfo
I have webservice, with method: [WebMethod] public byte[] GetFile(string FName) { System.IO.FileStream fs1 =
i have a webmethod in my webservice public class Service : System.Web.Services.WebService { [WebMethod]
I have a webmethod which is trying to construct xml data document and return
I have now something like this: public class Service1 : System.Web.Services.WebService { [WebMethod] public
I have a simple web service method which I'm trying to convert: <WebMethod()> _
I have a common base class from which all my ASMX webservice classes will
I have a WebMethod that looks like this which is used to populate a
I have WebService: public class Service1:WebService { private readonly MNConnection _conn; private MNLpu _lpu;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.