web services don't work
-
Hi, my friends. I have a question with my web services. he have two functions, the intellisense in the windows application show me this function whit the parameters of each one. But it does,t work. The error message is terrible: System.Web.Services.Protocols.SoapException was unhandled Message="System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: Cannot serialize the DataTable. DataTable name is not set.\n at System.Data.DataTable.WriteXmlSchema(XmlWriter writer, Boolean writeHierarchy)\n at System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter writer)\n at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)\n at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_SearchResponse(Object[] p)\n...........and much more. thanks.
-
Hi, my friends. I have a question with my web services. he have two functions, the intellisense in the windows application show me this function whit the parameters of each one. But it does,t work. The error message is terrible: System.Web.Services.Protocols.SoapException was unhandled Message="System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: Cannot serialize the DataTable. DataTable name is not set.\n at System.Data.DataTable.WriteXmlSchema(XmlWriter writer, Boolean writeHierarchy)\n at System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter writer)\n at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)\n at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_SearchResponse(Object[] p)\n...........and much more. thanks.
-
Hi, my friends. I have a question with my web services. he have two functions, the intellisense in the windows application show me this function whit the parameters of each one. But it does,t work. The error message is terrible: System.Web.Services.Protocols.SoapException was unhandled Message="System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: Cannot serialize the DataTable. DataTable name is not set.\n at System.Data.DataTable.WriteXmlSchema(XmlWriter writer, Boolean writeHierarchy)\n at System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter writer)\n at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)\n at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_SearchResponse(Object[] p)\n...........and much more. thanks.
DataTable name is not set
- kind of gives the game away. The webservice has issues that need resolving, i.e. the DataTable object they are trying to return needs to have it's
TableName
property set before it can be serialised. If you have access to the webservice code then you'll need to fix that. Otherwise you'll have to get in touch with whoever is responsible for the service. HTH -
DataTable name is not set
- kind of gives the game away. The webservice has issues that need resolving, i.e. the DataTable object they are trying to return needs to have it's
TableName
property set before it can be serialised. If you have access to the webservice code then you'll need to fix that. Otherwise you'll have to get in touch with whoever is responsible for the service. HTH -
What is the return type of the webmethod ?? Was it working separately as a function ??
Sathy
thanks Sathy. the function in the services return a datatable, but in the application if I do: DataTable appsearch = new DataTable(); appsearch = serv.Search(var1,var2); fail in build with the error message: Cannot implicity convert type 'Client.localhost.SearchResponseSearchResult' to 'System.Data.DataTable' what that mean? please.
-
thanks Sathy. the function in the services return a datatable, but in the application if I do: DataTable appsearch = new DataTable(); appsearch = serv.Search(var1,var2); fail in build with the error message: Cannot implicity convert type 'Client.localhost.SearchResponseSearchResult' to 'System.Data.DataTable' what that mean? please.
Ok in that case - the Webmethod is returning the type
SearchResponseSearchResult
which will have some series of properties (you'll probably find that the datatable is one of them), if you are using VStudio you can use object explorer to examine that object otherwise you'll be able to find the webservice proxy class to see the class definition ofSearchResponseSearchResult
. Then you should be able to do something like :Client.localhost.SearchResponseSearchResult objResult = serv.Search(var1, var2); DataTable appsearch; if(objResult.DataTableProperty ! = null) { appsearch = objResult.DataTableProperty; }
-
Ok in that case - the Webmethod is returning the type
SearchResponseSearchResult
which will have some series of properties (you'll probably find that the datatable is one of them), if you are using VStudio you can use object explorer to examine that object otherwise you'll be able to find the webservice proxy class to see the class definition ofSearchResponseSearchResult
. Then you should be able to do something like :Client.localhost.SearchResponseSearchResult objResult = serv.Search(var1, var2); DataTable appsearch; if(objResult.DataTableProperty ! = null) { appsearch = objResult.DataTableProperty; }
thanks a lot, Torsten Mauz. I can do what you explain here but the DataTableProperty i don't have. I think this can be because i am working with a xml web service and also this is the reason why i have System.XML.XmlElement[] SearchResponseSearchResult.Any I dont now where this Any come from but i think i can use this XmlElement. what you think? Something else, in this web services i have another function boolean, this function return boolean in the application without any problem.