Correct.

 

Try visiting your asmx page in a browser.

 

http: //localhost/BoATransformation/Survey.asmx?op=GetSurvey

 

You will be shown the exact format needed to make your request.

 

JK

 

 

From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Joseph Le Brech
Sent: Monday, May 18, 2009 1:47 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Calling ASMX from JQuery

 

doesn't asmx wrap the json in a soap object?

> Date: Mon, 18 May 2009 12:51:05 -0700
> Subject: [jQuery] Re: Calling ASMX from JQuery
> From: brakes...@gmail.com
> To: jquery-en@googlegroups.com
> 
> 
> Check in Firebug if the service returns data or a 501 error. Its
> under CONSOLE. You should allow it to "Show XMLHTTPRequests"
> 
> Also,
> 
> 1. The URL part seems to have an extra space after HTTP.. or maybe
> its just a typo:
> url: "http: //localhost/BoATransformation/Survey.asmx/
> GetSurvey"
> 
> 2. Or try removing "http://localhost totally
> 
> 
> 
> 
> On May 18, 3:30 pm, ebeworld <ebewo...@gmail.com> wrote:
> > Hi,
> >
> > I am trying to call ASMX method from JQuery without success. Following
> > is my code  and don't understand what i am missing.
> >
> > Thanks,
> > Ebe
> >
> > ///Something.js
> > function setQuestion() {
> >     $.ajax({
> >         type: "POST",
> >         data: "{}",
> >         dataType: "json",
> >         url: "http: //localhost/BoATransformation/Survey.asmx/
> > GetSurvey",
> >         contentType: "application/json; charset=utf-8",
> >         success: onSuccess
> >     });
> >
> > }
> >
> > function onSuccess(msg) {
> >     $("#questionCxt").append(msg);
> >
> > }
> >
> > ///SomethingElse.cs
> >
> > [WebService(Namespace = "http://tempuri.org/";)]
> > [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
> > [System.Web.Script.Services.ScriptService]
> > public class Survey : System.Web.Services.WebService {
> >
> >     public Survey () {
> >
> >     }
> >
> >     [WebMethod]
> >     [ScriptMethod(UseHttpGet = true)]
> >     public string GetSurvey() {
> >         return "Question: Who is Snoopy?";
> >     }
> >
> > }

  _____  

" Upgrade to Internet Explorer 8 Optimised for MSN. " Download Now
<http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U> 

Reply via email to