Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. web services don't work

web services don't work

Scheduled Pinned Locked Moved C#
visual-studiowcfsysadminxmljson
7 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    caradri
    wrote on last edited by
    #1

    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.

    I T 2 Replies Last reply
    0
    • C caradri

      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.

      I Offline
      I Offline
      imsathy
      wrote on last edited by
      #2

      What is the return type of the webmethod ?? Was it working separately as a function ??

      Sathy

      C 1 Reply Last reply
      0
      • C caradri

        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.

        T Offline
        T Offline
        Torsten Mauz
        wrote on last edited by
        #3

        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

        C 1 Reply Last reply
        0
        • T Torsten Mauz

          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

          C Offline
          C Offline
          caradri
          wrote on last edited by
          #4

          the datatable name is set

          1 Reply Last reply
          0
          • I imsathy

            What is the return type of the webmethod ?? Was it working separately as a function ??

            Sathy

            C Offline
            C Offline
            caradri
            wrote on last edited by
            #5

            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.

            T 1 Reply Last reply
            0
            • C caradri

              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.

              T Offline
              T Offline
              Torsten Mauz
              wrote on last edited by
              #6

              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 of SearchResponseSearchResult. 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; }

              C 1 Reply Last reply
              0
              • T Torsten Mauz

                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 of SearchResponseSearchResult. 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; }

                C Offline
                C Offline
                caradri
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups