Note that there are some explanatory texts on larger screens.

plurals
  1. POError trying to return data from web service using json
    primarykey
    data
    text
    <p>I am receiving "Internal Server Error" trying to call a web service method from json.</p> <p>Here is the WebService code:</p> <pre><code>Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.ComponentModel &lt;System.Web.Script.Services.ScriptService()&gt; _ &lt;System.Web.Services.WebService(Namespace:="http://tempuri.org/")&gt; _ &lt;System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)&gt; _ &lt;ToolboxItem(False)&gt; _ Public Class WebService1 Inherits System.Web.Services.WebService &lt;WebMethod()&gt; _ Public Function HelloWorld() As String Return "Hello World" End Function End Class </code></pre> <p>The calling page's markup and script is as follows:</p> <pre><code>&lt;%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" %&gt; &lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;WebForm1&lt;/title&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script &gt; $(document).ready(function () { // Add the page method call as an onclick handler for the div. $("#Result").click(function () { $.ajax({ type: "POST", url: "WebService1.asmx/HelloWorld", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", error: function(xhr, status, error) { $("#Result").html("xhr: " + xhr.text + "&lt;/br&gt;Status: " + status + "&lt;/br&gt;Error: " + error); }, success: function (data) { $("#Result").html(data.d); } }); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="Result"&gt;Click here ...&lt;/div&gt;&lt;br/&gt; &lt;input id="KenID" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I am not sure what to check to make this simple application work.</p> <p>Will appreciate some hints.</p> <p>Jacek</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload