troubleshooting Question

JQuery / asp .net web service

Avatar of doctor069
doctor069Flag for Canada asked on
.NET ProgrammingWCFjQuery
1 Comment1 Solution442 ViewsLast Modified:
Hi- I am trying to implement a web service with Jquery

Below is my code:

All i want it to do is post the data and return the "Hello World"

I keep getting a 500 Internal Server Error...

Just looking to do a simple Post

Any help would be appreciated (p.s. I'm using 2.0 framework - if that matters)
function removeImage(id) {
                $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "ProductPhotoDelete.asmx/HelloWorld",
                data: { a: 1, b: "test" },  
                dataType: "json",
                success: AjaxSucceeded,
                error: AjaxFailed
            }); 
    }

 function AjaxSucceeded(result) {
        alert(result.d);
    }

    function AjaxFailed(result) {
        alert(result.status + ' ' + result.statusText);
    }  

'----------------------------------------------------------------------------------

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.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class ProductPhotoDelete
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function HelloWorld(ByVal a As Integer, ByVal b As String) As String
        Return "Hello World"
    End Function

    <WebMethod()> _
     Public Function HelloToYou(ByVal name As String) As String
        Return "Hello " + name
    End Function
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros