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. Interacting with a Page Web Service (OData v4) Error

Interacting with a Page Web Service (OData v4) Error

Scheduled Pinned Locked Moved C#
csharphelpasp-netsysadminsales
20 Posts 4 Posters 0 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.
  • L Lost User

    Unfortunately, you're posting "code fragments"; which makes it hard to discern what you are or are not doing. You previously hinted it might be a "relation" thing; yes, data services does "lazy loading"; cannot tell from your post if you addressed this. [How to: Load Related Entities (WCF Data Services)](https://msdn.microsoft.com/en-us/library/dd756366(v=vs.110).aspx)

    "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

    M Offline
    M Offline
    MaWeRic
    wrote on last edited by
    #10

    Lets see if I can put up a sample thing for you. Yes lazyloading might be a thing just like in EF. Need to turn it off maybe? Thanks // zd

    M L 2 Replies Last reply
    0
    • M MaWeRic

      Lets see if I can put up a sample thing for you. Yes lazyloading might be a thing just like in EF. Need to turn it off maybe? Thanks // zd

      M Offline
      M Offline
      MaWeRic
      wrote on last edited by
      #11

      Cant see anything in fiddler that draws me into that relation-direction. Its just plain-data. Have to dive deeper into that.

      Z 1 Reply Last reply
      0
      • M MaWeRic

        Lets see if I can put up a sample thing for you. Yes lazyloading might be a thing just like in EF. Need to turn it off maybe? Thanks // zd

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #12

        Perhaps only using a Browser for now will help to clarify what is going on: [Accessing the Service from a Web Browser (WCF Data Services Quickstart)](https://msdn.microsoft.com/en-us/library/dd728279(v=vs.110).aspx) I suggest you try it.

        "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

        M 2 Replies Last reply
        0
        • M MaWeRic

          Cant see anything in fiddler that draws me into that relation-direction. Its just plain-data. Have to dive deeper into that.

          Z Offline
          Z Offline
          zequion
          wrote on last edited by
          #13

          I'm thinking the possibility that from Main () can access its copy of Name_Common to do Name_Common.Cls_Common.StCommon = new Name_Common.St_Common(); For now I do not know how to do it because there is an error. So when I want to use a class, I can copy Main's global structure to that of the class. I have remembered that I did a function to make (cast) of one estrcuture to another one. For now I can not make new Name_Common.St_Common(); of Main(). The brain has stopped me for days. I can also someone something about points 2 and 3 of debugger employment? Thank you.

          P 1 Reply Last reply
          0
          • Z zequion

            I'm thinking the possibility that from Main () can access its copy of Name_Common to do Name_Common.Cls_Common.StCommon = new Name_Common.St_Common(); For now I do not know how to do it because there is an error. So when I want to use a class, I can copy Main's global structure to that of the class. I have remembered that I did a function to make (cast) of one estrcuture to another one. For now I can not make new Name_Common.St_Common(); of Main(). The brain has stopped me for days. I can also someone something about points 2 and 3 of debugger employment? Thank you.

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #14

            What has this got to do with this question? Please don't hijack others posts.

            This space for rent

            1 Reply Last reply
            0
            • L Lost User

              Perhaps only using a Browser for now will help to clarify what is going on: [Accessing the Service from a Web Browser (WCF Data Services Quickstart)](https://msdn.microsoft.com/en-us/library/dd728279(v=vs.110).aspx) I suggest you try it.

              "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

              M Offline
              M Offline
              MaWeRic
              wrote on last edited by
              #15

              I am on to it ... Getting back ... //zd

              1 Reply Last reply
              0
              • L Lost User

                Perhaps only using a Browser for now will help to clarify what is going on: [Accessing the Service from a Web Browser (WCF Data Services Quickstart)](https://msdn.microsoft.com/en-us/library/dd728279(v=vs.110).aspx) I suggest you try it.

                "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

                M Offline
                M Offline
                MaWeRic
                wrote on last edited by
                #16

                Everything ok with browsing the service. Filtering etc work like a charm. This is for sure client-issue. I have tried to generate proxyclasses using 2 different tools that state they can produce proxy for OData v4. If I try to use Add Service Reference I get en error like this :

                Quote:

                The document at the url file:///e:/client.xml was not recognized as a known document type. The error message from each known type may help you fix the problem: - Report from 'XML Schema' is 'The root element of a W3C XML Schema should be and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'. - Report from 'DISCO Document' is 'Discovery document at the URL file:///e:/client.xml could not be found.'. - The document format is not recognized. - Report from 'WSDL Document' is 'There is an error in XML document (2, 2).'. - was not expected. If the service is defined in the current solution, try building the solution and adding the service reference again.

                Guess That built in proxyclass generator only handles up to V3? This is what my Schema look like:

                Thanks

                L 1 Reply Last reply
                0
                • M MaWeRic

                  Everything ok with browsing the service. Filtering etc work like a charm. This is for sure client-issue. I have tried to generate proxyclasses using 2 different tools that state they can produce proxy for OData v4. If I try to use Add Service Reference I get en error like this :

                  Quote:

                  The document at the url file:///e:/client.xml was not recognized as a known document type. The error message from each known type may help you fix the problem: - Report from 'XML Schema' is 'The root element of a W3C XML Schema should be and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'. - Report from 'DISCO Document' is 'Discovery document at the URL file:///e:/client.xml could not be found.'. - The document format is not recognized. - Report from 'WSDL Document' is 'There is an error in XML document (2, 2).'. - was not expected. If the service is defined in the current solution, try building the solution and adding the service reference again.

                  Guess That built in proxyclass generator only handles up to V3? This is what my Schema look like:

                  Thanks

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #17

                  Yes; when your previously mentioned you used a "generator" .... It's almost a given you will have less control and less transparency. I usually go "down to the metal" first time around; and then I MAY go "fancy". [OData - the Best Way to REST](http://www.odata.org/) [Home · object/Simple.OData.Client Wiki · GitHub](https://github.com/object/Simple.OData.Client/wiki)

                  "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

                  M 1 Reply Last reply
                  0
                  • L Lost User

                    Yes; when your previously mentioned you used a "generator" .... It's almost a given you will have less control and less transparency. I usually go "down to the metal" first time around; and then I MAY go "fancy". [OData - the Best Way to REST](http://www.odata.org/) [Home · object/Simple.OData.Client Wiki · GitHub](https://github.com/object/Simple.OData.Client/wiki)

                    "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

                    M Offline
                    M Offline
                    MaWeRic
                    wrote on last edited by
                    #18

                    Thanks Gerry ... yes I dont like it either but client wanted an easy way to code against Microsoft Dynamics. I have been all over that Odata-site and everything work as intended if you do it the raw way, I do like the look of Simple.OData.Client. Maybe try it out. Have you tested it? We are sending in the question to NAV developement team to see if they have any answer to why it dont work with a generator. Thanks for all your help ;)

                    L 1 Reply Last reply
                    0
                    • M MaWeRic

                      Thanks Gerry ... yes I dont like it either but client wanted an easy way to code against Microsoft Dynamics. I have been all over that Odata-site and everything work as intended if you do it the raw way, I do like the look of Simple.OData.Client. Maybe try it out. Have you tested it? We are sending in the question to NAV developement team to see if they have any answer to why it dont work with a generator. Thanks for all your help ;)

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #19

                      You're welcome. No, I haven't tried "Simple.OData.Client"; but it has a good "smell". But if your "raw" methods are working, I wouldn't bother. I also wouldn't bother NAV. I would instead consider spending time giving the client an "attitude adjustment".

                      "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

                      M 1 Reply Last reply
                      0
                      • L Lost User

                        You're welcome. No, I haven't tried "Simple.OData.Client"; but it has a good "smell". But if your "raw" methods are working, I wouldn't bother. I also wouldn't bother NAV. I would instead consider spending time giving the client an "attitude adjustment".

                        "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

                        M Offline
                        M Offline
                        MaWeRic
                        wrote on last edited by
                        #20

                        We are on the same level ;) I try out the Simple Client. I love the smell too. //ZD

                        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