Could anyone give me a guide or example of how to test the web service
Here is my web service but i don't know how to write the test for it
public class Service{
private string m_ERR_NO_LISTING= "No data found";
private static readonly ILog log = LogManager.GetLogger(typeof(Service));
[WebMethod]
public com.xignite.www.Category [] GetCategoriesAndTopics()
{
com.xignite.www.Category[] ArrayOfCategory= null;
try
{
ArrayOfCategory = Service.GetCategoriesAndTopics();
}
catch(Exception e) {
log.Error("Invoke GetCategoriesAndTopics operation failed", e);
throw new SoapException(e.Message, SoapException.ServerFaultCode);
}
if (ArrayOfCategory!=null && ArrayOfCategory.Length>0 &&
ArrayOfCategory[0]!=null)
{
if (IsOutcomeResultFailed(ArrayOfCategory[0]))
{
throw new SoapException(ArrayOfCategory[0].Message,
SoapException.ServerFaultCode);
}
}
if(ArrayOfCategory==null ||ArrayOfCategory.Length==0 ||
ArrayOfCategory[0]==null)
{
throw new SoapException(m_ERR_NO_LISTING,
SoapException.ServerFaultCode);
}
return ArrayOfCategory;
}
private bool IsOutcomeResultFailed(com.xignite.www.Common common)
{
return common!=null && common.Outcome!
=com.xignite.www.OutcomeTypes.Success;
}
}