[Mono-aspnet-list] .NET 3.5 webservice not working in Mono but works fine on ASP.NET server.
Travis959
Travis959 at hotmail.com
Sun May 22 01:15:30 EDT 2011
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.
More information about the Mono-aspnet-list
mailing list