Click here to Skip to main content
15,307,242 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..

This is my xml request


<user>
<Provider>
<ProviderReview>
<BedSideMannerRating>2</BedSideMannerRating>
<PatientId>20eab68a-1627-462c-816f-df098c319d42</PatientId>
<ProviderId>ec245cf7-b8a2-4142-8f90-8ecd2f6bb037</ProviderId>
<RecommendRating>1</RecommendRating>
<WaitTimingRating>1</WaitTimingRating>
</ProviderReview>
</Provider>
<UserBusiness></UserBusiness>
<UserNotes></UserNotes>
<UserPreferences></UserPreferences>
</user>
</InsertUserRequest>

by using this user data is becoming null.suggest me the correct format. exception is
Object reference not set to an instance of an object.

Thanks in advance...
Posted
Updated 6-Nov-12 0:01am
v4

UserBusiness appears to be null.
UserNotes appears to be null.
UserPreferences appears to be null.

With an object reference error, it probably means that one or more of these objects must be populated for the call to succeed.
   
Their can be multiple possibilities for universal error known as "Object reference not set to an instance of an object". :)

Check order of your nodes of XML matching with order of your DataContract Class properties. Because it wont deserialize if order is incorrect.

You can also have a look at my below Tip/Trick on the topic "Debug WCF REST Service".

Debug WCF REST Service.

Hope it should help to resolve your error.

Cheers - Rais
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900