Wen i run the local debug for my web service it shows up just fine. but when I put it up to my server I get a strange error like an XML Markup error.
XML Parsing Error: mismatched tag. Expected: </p>. Location: http://-----/2/api/api.asmx Line Number 61, Column 17: </ul>
Below is my asmx file. I have a Twitter and OAuth class. But I think the issue is when the website is generated it creates an error.
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.SqlClient;
using WebAPI;
namespace API
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://-----/2/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// 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 api : System.Web.Services.WebService
{
WebAPI.OAuth oauth;
WebAPI.Twitter twitter;
public api()
{
oauth = new OAuth(); // Initialize OAuth api
// Initialize Twittr api
// <@TODO: Add facebook initialize>
// <@TODO: Add linkedIn initialize>
// <@TODO: Add myspace initialize>
}
[WebMethod]
public string post(string ID, string api, string postadata)
{
// Validate ID
/*
* Call Validate then go to below. (should have flags for what is allowed)
*/
if (api.ToLower() == "twitter")
{
twitter = new Twitter(postadata);
twitter.DoRequest();
return twitter.GetResponse();
}
if (api.ToLower() == "facebook")
{
return "Success";
}
return "Invalid API type!";
}
}
}
Oh and my Webserver is a windows web server with all the .NET’s available currently using .NET 3.5 (2.0 Integrated). Let me know if there is anything else you need me to post. like the Web.config etc.
Thank you in advance!
So I am pretty sure I had an issue with my Web.Config. I ended up making a new .NET service project and porting the code over. and it works fine.