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. codeproject webServices

codeproject webServices

Scheduled Pinned Locked Moved C#
csharpcomhelpquestionlounge
3 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.
  • L Offline
    L Offline
    Lior Shoval
    wrote on last edited by
    #1

    Hi. I'm new to C# and WS in general and i'm trying to write a simple windows application that get's the latest article briefs from codeproject's webService, but i keep getting an exception. maybe you can help me out here ? com.codeproject.www.LatestBrief ws = new com.codeproject.www.LatestBrief(); int maxNum = ws.GetMaxArticleListLength(); com.codeproject.www.ArticleBrief[] ar = ws.GetLatestArticleBrief(maxNum); foreach (com.codeproject.www.LatestBrief lb in ar ) { articles.Items.Add(lb.ToString()); } Thanks.

    H 1 Reply Last reply
    0
    • L Lior Shoval

      Hi. I'm new to C# and WS in general and i'm trying to write a simple windows application that get's the latest article briefs from codeproject's webService, but i keep getting an exception. maybe you can help me out here ? com.codeproject.www.LatestBrief ws = new com.codeproject.www.LatestBrief(); int maxNum = ws.GetMaxArticleListLength(); com.codeproject.www.ArticleBrief[] ar = ws.GetLatestArticleBrief(maxNum); foreach (com.codeproject.www.LatestBrief lb in ar ) { articles.Items.Add(lb.ToString()); } Thanks.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Why don't you tell us what the exception is? It's hard to help you with a problem when we don't know what the problem is. Besides, lb.ToString (defined by LatestBrief.ToString) probably won't give you want you want. By default, ToString returns the type (so "com.codeproject.www.LatestBrief"). You have to output the data yourself, or if articles is an ArrayList or something just add lb, since you can't reconstitute a LatestBrief just from the type name.

      Microsoft MVP, Visual C# My Articles

      L 1 Reply Last reply
      0
      • H Heath Stewart

        Why don't you tell us what the exception is? It's hard to help you with a problem when we don't know what the problem is. Besides, lb.ToString (defined by LatestBrief.ToString) probably won't give you want you want. By default, ToString returns the type (so "com.codeproject.www.LatestBrief"). You have to output the data yourself, or if articles is an ArrayList or something just add lb, since you can't reconstitute a LatestBrief just from the type name.

        Microsoft MVP, Visual C# My Articles

        L Offline
        L Offline
        Lior Shoval
        wrote on last edited by
        #3

        Thanks for the reply. The exception information is: An unhandled exception of type 'System.NullReferenceException' occurred in codeProjectWs.exe Additional information: Object reference not set to an instance of an object. When i use the same code to the the messageBoards brief, it works just fine. it seems as if the web service isn't functioning properly. as for the .ToString, i get you. Thanks again.

        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