[Mono-aspnet-list] .NET 3.5 webservice not working in Mono but works fine on ASP.NET server.
The_Assimilator
ian.kemp at gmail.com
Sun May 22 07:51:29 EDT 2011
Have you considered checking that service.Error is not null before
trying to access its .Description property?
Also you should probably change your Hotmail password, since posting it
to the Internet is... not a good idea.
------ Original Message ------
Subject: Re: [Mono-aspnet-list] .NET 3.5 webservice not working in Mono but
works fine on ASP.NET server.
Date: Sat, 21 May 2011 22:15:30 -0700 (PDT)
From: Travis959 <Travis959 at hotmail.com>
To: mono-aspnet-list at lists.ximian.com
> Travis959 wrote:
>> using System;
>> using System.Collections.Generic;
>> using System.Linq;
>> using System.Web;
>> using System.Web.Services;
>> using ar.com.indiesoftware.psnApi.USA;
>> using ar.com.indiesoftware.psnApi.Entities;
>> using System.Net;
>>
>> ///<summary>
>> /// Summary description for PSN
>> ///</summary>
>>
>> [WebService(Namespace = "PSN Information")]
>> [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
>> // To allow this Web Service to be called from script, using ASP.NET AJAX,
>> uncomment the following line.
>> // [System.Web.Script.Services.ScriptService]
>> public class psn : System.Web.Services.WebService
>> {
>>
>> public psn()
>> {
>>
>> }
>>
>>
>> [WebMethod]
>>
>> public PSNId getPSNID(string sPSNID)
>> {
>> PSNServices service = new PSNServices();
>> CookieContainer cookies = null;
>> // get cookies from some cache or storage for fast access
>> if (cookies == null) // we need to log to psn
>> {
>> if (service.SetIdentity("Travis959 at hotmail.com", "Mittycat1"))
>> {
>> cookies = service.Cookies;
>> // save cookies to a cache or storage for next use
>> PSNId id = service.GetPSNId(sPSNID, cookies);
>> return id;
>> }
>> else
>> {
>> // get the error
>> string Error = service.Error.Description;
>> return null;
>> }
>>
>> }
>> else
>> {
>> // get the error
>> string Error = service.Error.Description;
>> return null;
>> }
>> }
>> [WebMethod]
>> public List<Game> getGames(string sPSNID)
>> {
>> PSNServices service = new PSNServices();
>> CookieContainer cookies = null;
>> // get cookies from some cache or storage for fast access
>> if (cookies == null) // we need to log to psn
>> {
>> if (service.SetIdentity("Travis959 at hotmail.com", "Mittycat1"))
>> {
>> cookies = service.Cookies;
>> // save cookies to a cache or storage for next use
>> List<Game> games = service.GetGames(sPSNID, cookies);
>> return games;
>> }
>> else
>> {
>> // get the error
>> string Error = service.Error.Description;
>> return null;
>> }
>>
>> }
>> else
>> {
>> // get the error
>> string Error = service.Error.Description;
>> return null;
>> }
>> }
>>
>> }
>>
>>
>>
> This is my psn.cs file that is included in the asmx. I'm still getting this
> error everytime I attempt to run the asmx. Mostly the "Object reference not
> set to an instance of an object" error.
>
> Is there anything in my script that prevents it from running on Mono?
>
> --
> View this message in context: http://mono.1490590.n4.nabble.com/NET-3-5-webservice-not-working-in-Mono-but-works-fine-on-ASP-NET-server-tp3537987p3541619.html
> Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
> _______________________________________________
> Mono-aspnet-list mailing list
> Mono-aspnet-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>
More information about the Mono-aspnet-list
mailing list