Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 7th, 2007, 04:30 AM
Registered User
 
Join Date: Jul 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Object reference not set - WebReference WS

Hi There,
Here's some puzzling one...
I've added a web reference to my project and now i cant't get it instantiated, i always get

'Object reference not set to an instance of an object.' exception.

Here's C# code:

1: OTA_AirAvailRQ OTA_AirAvailRQ_Document = new OTA_AirAvailRQ();
2: OTA_AirAvailRQ_Document.POS.Source[0].PseudoCityCode = "LAS1S210D";

I get the exception on line 2, intellisene displays everthing ok, and it compiles fine, but at runtime it blows.

Any ideas, is it something that i'm forgetting of ?
Thanks a lot.


Reply With Quote
  #2 (permalink)  
Old July 9th, 2007, 07:47 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Something doesn't look right with your syntax:

What is the POS property of the ORA_AirAvailRQ class?

Is ORA_AirAvailRQ the web proxy class? I don't see any method calls on that. Generally, you should be making a method call and then work with what is returned.

-Peter
Reply With Quote
  #3 (permalink)  
Old August 1st, 2007, 06:23 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

POS.Source[0].PseudoCityCode

There is a high probability that the source of the error is coming from you array element Source[0] not having been initialized to any object.

Check that the array contains something


www.xhydra.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
object reference not set to instant of an object shahidrasul ASP.NET 2.0 Basics 1 September 5th, 2008 02:01 PM
Object reference not set flashmanTom BOOK: Beginning VB.NET Databases 1 February 19th, 2008 06:29 AM
Object Reference not set to an instance of object srinivas_chakka ASP.NET 1.0 and 1.1 Professional 0 February 8th, 2006 11:56 AM
Object reference not set to an instance... steelman BOOK: ASP.NET Website Programming Problem-Design-Solution 6 May 7th, 2004 02:03 AM



All times are GMT -4. The time now is 02:08 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.