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. Creating Web Service in C#

Creating Web Service in C#

Scheduled Pinned Locked Moved C#
csharphelplearning
12 Posts 2 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.
  • K Offline
    K Offline
    kendo17
    wrote on last edited by
    #1

    typing in <%@ WebService Language="C#" Class="StockQuote.XPlatformServices" %> at top of code page but it does not like this for some reason i am using 2005 web developer, but coding from an old book, can anyone please help The web service will be crossplatform. 1. keyword,identifier, or string expected after verbatim specifier:@ 2. A namespace does not directly contain members such as fields or methods Please HELP Thank You

    P 1 Reply Last reply
    0
    • K kendo17

      typing in <%@ WebService Language="C#" Class="StockQuote.XPlatformServices" %> at top of code page but it does not like this for some reason i am using 2005 web developer, but coding from an old book, can anyone please help The web service will be crossplatform. 1. keyword,identifier, or string expected after verbatim specifier:@ 2. A namespace does not directly contain members such as fields or methods Please HELP Thank You

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      Where have you put the @WebService directive? In your .asmx file? Or in your .asmx.cs file?

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      K 1 Reply Last reply
      0
      • P pmarfleet

        Where have you put the @WebService directive? In your .asmx file? Or in your .asmx.cs file?

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        K Offline
        K Offline
        kendo17
        wrote on last edited by
        #3

        in the service.cs file

        K P 2 Replies Last reply
        0
        • K kendo17

          in the service.cs file

          K Offline
          K Offline
          kendo17
          wrote on last edited by
          #4

          When i enter the code in the .asmx file it it comes back with error when i build it; could not create type 'StockQuote.XPlatformServices' Any Ideas. Is it that this code does not run from within the program where it is created that it requires to be called from another platform language.:confused:

          P 1 Reply Last reply
          0
          • K kendo17

            in the service.cs file

            P Offline
            P Offline
            pmarfleet
            wrote on last edited by
            #5

            The WebService directive should only go in the .asmx file. The .cs file i only for your C# code. If you create your web service using Visual Studio, the .asmx file is automatically generated for you. You shouldn't need to modify the directive yourself.

            Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

            K 1 Reply Last reply
            0
            • K kendo17

              When i enter the code in the .asmx file it it comes back with error when i build it; could not create type 'StockQuote.XPlatformServices' Any Ideas. Is it that this code does not run from within the program where it is created that it requires to be called from another platform language.:confused:

              P Offline
              P Offline
              pmarfleet
              wrote on last edited by
              #6

              In the code-behind file for your webservice, you should create a class called XPlatformServices that belongs to the StockQuote namespace.

              Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

              1 Reply Last reply
              0
              • P pmarfleet

                The WebService directive should only go in the .asmx file. The .cs file i only for your C# code. If you create your web service using Visual Studio, the .asmx file is automatically generated for you. You shouldn't need to modify the directive yourself.

                Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

                K Offline
                K Offline
                kendo17
                wrote on last edited by
                #7

                i altered the asmx as so i can call the web service from another language platform Java. I understand that this is the code that i need but dont know what is the correct way to use it.

                P 1 Reply Last reply
                0
                • K kendo17

                  i altered the asmx as so i can call the web service from another language platform Java. I understand that this is the code that i need but dont know what is the correct way to use it.

                  P Offline
                  P Offline
                  pmarfleet
                  wrote on last edited by
                  #8

                  kendo17 wrote:

                  I understand that this is the code that i need but dont know what is the correct way to use it.

                  I don't understand what you mean. Is there still a problem with your .asmx file? If so, post your code.

                  Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

                  K 1 Reply Last reply
                  0
                  • P pmarfleet

                    kendo17 wrote:

                    I understand that this is the code that i need but dont know what is the correct way to use it.

                    I don't understand what you mean. Is there still a problem with your .asmx file? If so, post your code.

                    Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

                    K Offline
                    K Offline
                    kendo17
                    wrote on last edited by
                    #9

                    this is the code i am using in the asmx file i have saved it as SimpleStockQuote and it is on my C: <%@ WebService Language="C#" Class="SimpleStockQuote.XPlatformServices" %> -- modified at 13:53 Sunday 4th November, 2007

                    P 1 Reply Last reply
                    0
                    • K kendo17

                      this is the code i am using in the asmx file i have saved it as SimpleStockQuote and it is on my C: <%@ WebService Language="C#" Class="SimpleStockQuote.XPlatformServices" %> -- modified at 13:53 Sunday 4th November, 2007

                      P Offline
                      P Offline
                      pmarfleet
                      wrote on last edited by
                      #10

                      That looks OK. Are you still having problems?

                      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

                      K 1 Reply Last reply
                      0
                      • P pmarfleet

                        That looks OK. Are you still having problems?

                        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

                        K Offline
                        K Offline
                        kendo17
                        wrote on last edited by
                        #11

                        yes sorted it was had not changed the class details thank you i need to complete this tonight or i am going to struggle at Uni.

                        P 1 Reply Last reply
                        0
                        • K kendo17

                          yes sorted it was had not changed the class details thank you i need to complete this tonight or i am going to struggle at Uni.

                          P Offline
                          P Offline
                          pmarfleet
                          wrote on last edited by
                          #12

                          OK. Good luck.

                          Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

                          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