Hola Mundo en gvSIG. Extender gvSIG con Java

http://www.gisandchips.org/2009/10/01/hola-mundo-con-gvsig-2-0-y-con-eclipse/

http://www.gvsig.org/web/docdev/docs/v2_0/gvsig-devel-guide/

Llamar a un webmethod de un WebService con jQuery

Versiones:
Visual Studio 2008
jquery-1.4.1.min.js
System.Web.Extensions.dll versión 3.5.0.0

Código C#

using System;
using System.Web.Services;

namespace wsX
{
    /// <summary>
    /// Descripción breve de Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]  
    [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {
        [WebMethod]
        public string Prueba1(int param)
        {        
            return "{ 'datos': [ {'nombre': 'Juan', 'direccion': 'Colonia 1212'}, {'nombre': 'Pedro', 'direccion': 'Mercedes 1111'} ] }";
        }
    }
}


Código html:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" language="javascript" src="jquery-1.4.1.min.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Prueba 1</title>

<body>

<script type="text/javascript">

$(document).ready(function()
{
jQuery.ajax({
  type: "POST",
  url: "http://localhost:2366/Service1.asmx/Prueba1",
  data: "{'param': '123'}",
  contentType:"application/json; charset=utf-8",
  dataType:"json",
  cache: false,
  success: function(response) {
var v = getJSON(response);

alert("Resultado: " + v.datos[0].nombre);
  }
});

function getJSON(data_obj)
{
if (data_obj.d)
 data_ok = data_obj.d;
else
data_ok = data_obj;

evalJson = eval("var varJSON = " + data_ok + ";");

return varJSON;
}
});

</script>

</body>
</html>

Ejecutar web service desde maquina remota (ERROR: The test form is only available for requests from the local machine)

Agregar estas líneas a web.config:


<configuration> <system.web> <webServices> <protocols> <add name="HttpGet"/> <add name="HttpPost"/> </protocols> </webServices> </system.web> </configuration>