Help, problem with Web Service (ASP.NET, VWD 2005, XP, IIS 5.1)
-
Hi I’m trying to create a Web Service with Visual Web Developer 2005 (C#), Win XP Pro SP2 (Spanish), IIS 5.1. it works ok from de debug option, but when I try to call it directly from the browser I get the following error: Referencia a objeto no establecida como instancia de un objeto (Object reference not set to an instance of an object) NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.] System.Web.Hosting.ISAPIWorkerRequestInProc.GetServerVariable(String name) +1618 System.Web.Security.WindowsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +593 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64 This is whit de standard code generated by default by VWD. Any ideas of what is wrong? :( Walter Charrière
-
Hi I’m trying to create a Web Service with Visual Web Developer 2005 (C#), Win XP Pro SP2 (Spanish), IIS 5.1. it works ok from de debug option, but when I try to call it directly from the browser I get the following error: Referencia a objeto no establecida como instancia de un objeto (Object reference not set to an instance of an object) NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.] System.Web.Hosting.ISAPIWorkerRequestInProc.GetServerVariable(String name) +1618 System.Web.Security.WindowsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +593 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64 This is whit de standard code generated by default by VWD. Any ideas of what is wrong? :( Walter Charrière
I don't know too much about ASP.net, but unless that script creates a WDSL then you should not access it unless making a soap request.
Brad Australian - Christian Graus on "Best books for VBscript" A big thick one, so you can whack yourself on the head with it.
-
I don't know too much about ASP.net, but unless that script creates a WDSL then you should not access it unless making a soap request.
Brad Australian - Christian Graus on "Best books for VBscript" A big thick one, so you can whack yourself on the head with it.
Hi The .wsdl file is there, an accesing it from a web page whit a post request. Here is the full code: ---------------------------------------------------------------------------------------------------------------------------------------------------------------------< Web Service File: Service.asmx <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="Service" %> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------< File: Service.cs (in APP_Code sub dir) using System; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; [WebService(Namespace = "http://localhost/WebServices")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class Service : System.Web.Services.WebService { public Service () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public string[] ListaCiudades() { string[] Ciudades = new string[30]; Ciudades[0] = "Asunción"; Ciudades[1] = "Belmopan"; Ciudades[2] = "Bogota"; Ciudades[3] = "Brasilia"; Ciudades[4] = "Bridgetown"; Ciudades[5] = "Buenos Aires"; Ciudades[6] = "Caracas"; Ciudades[7] = "Georgetown"; Ciudades[8] = "Guatemala"; Ciudades[9] = "Kingston"; Ciudades[10] = "La Habana"; Ciudades[11] = "La Paz"; Ciudades[12] = "Lima"; Ciudades[13] = "Managua"; Ciudades[14] = "Mexico"; Ciudades[15] = "Montevideo"; Ciudades[16] = "Nassau"; Ciudades[17] = "Otawa"; Ciudades[18] = "Panama"; Ciudades[19] = "Paramaribo"; Ciudades[20] = "Puerto España"; Ciudades[21] = "Puerto Príncipe"; Ciudades[22] = "Quito"; Ciudades[23] = "San José"; Ciudades[24] = "San Salvador"; Ciudades[25] = "Santiago"; Ciudades[26] = "Santo Domingo"; Ciudades[27] = "Sucre"; Ciudades[28] = "Tegusigalpa"; Ciudades[29] = "Washington"; return Ciudades; } } --------------------------------------------------------------------------------------------------------------------------------------------------------------------- File: Service.asmx.wsdl (generated by http:/
-
Hi The .wsdl file is there, an accesing it from a web page whit a post request. Here is the full code: ---------------------------------------------------------------------------------------------------------------------------------------------------------------------< Web Service File: Service.asmx <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="Service" %> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------< File: Service.cs (in APP_Code sub dir) using System; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; [WebService(Namespace = "http://localhost/WebServices")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class Service : System.Web.Services.WebService { public Service () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public string[] ListaCiudades() { string[] Ciudades = new string[30]; Ciudades[0] = "Asunción"; Ciudades[1] = "Belmopan"; Ciudades[2] = "Bogota"; Ciudades[3] = "Brasilia"; Ciudades[4] = "Bridgetown"; Ciudades[5] = "Buenos Aires"; Ciudades[6] = "Caracas"; Ciudades[7] = "Georgetown"; Ciudades[8] = "Guatemala"; Ciudades[9] = "Kingston"; Ciudades[10] = "La Habana"; Ciudades[11] = "La Paz"; Ciudades[12] = "Lima"; Ciudades[13] = "Managua"; Ciudades[14] = "Mexico"; Ciudades[15] = "Montevideo"; Ciudades[16] = "Nassau"; Ciudades[17] = "Otawa"; Ciudades[18] = "Panama"; Ciudades[19] = "Paramaribo"; Ciudades[20] = "Puerto España"; Ciudades[21] = "Puerto Príncipe"; Ciudades[22] = "Quito"; Ciudades[23] = "San José"; Ciudades[24] = "San Salvador"; Ciudades[25] = "Santiago"; Ciudades[26] = "Santo Domingo"; Ciudades[27] = "Sucre"; Ciudades[28] = "Tegusigalpa"; Ciudades[29] = "Washington"; return Ciudades; } } --------------------------------------------------------------------------------------------------------------------------------------------------------------------- File: Service.asmx.wsdl (generated by http:/
-
Ups!!!, sorry The wsdl is not shown in the prior message, I forget to mark ignore tags. Here iy is:
Finally I solved the problem. As I think it was an installation problem, to solve y find an article in Microsoft Knowledge Base: See: http://support.microsoft.com/kb/309051 I run in the command line C:>cd %windir%\system32\inetsrv C:>rundll32 wamreg.dll, CreateIISPackage C:>regsvr32 asptxn.dll C:>IISRESET /restart Problem solved. I hope this be of use to someone else, and avoid looking articles and web forums for a month or two to find the answer. :-D :-D