Ravi Patel

Ravi Patel

  • 274
  • 6.8k
  • 1.4m

webservices invoking error

Aug 22 2014 1:18 AM
i have created web services method
<WebMethod()> _
Public Function getAddressBookList()
try
Dim db As Database
Dim dbCommandWrapper As DbCommand = Nothing
Dim result As DataSet= Nothing
db = DatabaseFactory.CreateDatabase
dbCommandWrapper = db.GetStoredProcCommand("spScribeRefphyAddressbookSelect")
result = db.ExecuteDataSet(dbCommandWrapper)
Catch ex As Exception
End Try
Return result

End Function
i am trying to Invoke webservices but i am getting error
System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type System.Data.DataSet may not be used in this context. To use System.Data.DataSet as a parameter, return type, or member of a class or struct, the parameter, return type, or member must be declared as type System.Data.DataSet (it cannot be object). Objects of type System.Data.DataSet may not be used in un-typed collections, such as ArrayLists. at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String name, String ns, Object o, Boolean xsiType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_Object(String n, String ns, Object o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write7_anyType(Object o) at Microsoft.Xml.Serialization.GeneratedAssembly.ObjectSerializer5.Serialize(Object objectToSerialize, XmlSerializationWriter writer) at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces) at System.Web.Services.Protocols.XmlReturnWriter.Write(HttpResponse response, Stream outputStream, Object returnValue) at System.Web.Services.Protocols.WebServiceHandler.WriteReturns(Object[] returnValues) at System.Web.Services.Protocols.WebServiceHandler.Invoke()