Donald Jansen
Donald Jansen

Reputation: 1985

Webservices in Asp.net

I have the following webmethod in my application

[WebMethod]
public bool Test(string id)
{
    return true;
}

using WebRequest.Create(..) I get the following xml file

<?xml version="1.0" encoding="utf-8"?>
<boolean xmlns="http://tempuri.org/">true</boolean>

and using the following code

 XmlSerializer ser = new XmlSerializer(typeof(bool));
 var result = (bool)ser.Deserialize(responseStream);

I get the following exception

Upvotes: 1

Views: 49

Answers (1)

Donald Jansen
Donald Jansen

Reputation: 1985

I managed to get it working by doing the following

XmlSerializer serializer = new XmlSerializer(typeof(T), "http://tempuri.org/");

Upvotes: 1

Related Questions