Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 06-06-2009
Member
 
Join Date: Nov 2008
Posts: 1,514
"The component was not expected" error

I am having a project designed in ASP.NET which is having a webreference to a web service. I recently added an object as a parameter to the webmethod in the webservice which calls business layer to do some calculations. But this gives me error saying "The component was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically." Can you explain me what is the cause of this error message?
Reply With Quote
  #2  
Old 06-06-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: "The component was not expected" error

You generate serialization code to get XML serialization work. You first create serialization/de-serialization code in ASP.NET, compile it and then compile it. All of this should be done in just first call to the web service. Once the first call complete, do not recreate this code again. XmlInclude tells us know which serialization code we should use.
Reply With Quote
  #3  
Old 06-06-2009
Member
 
Join Date: May 2008
Posts: 4,339
Re: "The component was not expected" error

The XmlInclude class can only serialize types that it is aware of.

This can be achieved in two ways:

1) Expose the property as an XmlElement and handle the serialization from your object into XML
2) Create an extension and manage the serialization in the extension.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: ""The component was not expected" error"
Thread Thread Starter Forum Replies Last Post
Error "A corrected hardware error has occurred. Component: PCI Express Root Port" on Intel DX58SO2 Cheeen-Hal Motherboard Processor & RAM 2 11-05-2012 02:16 AM
Excel Error message: "External table is not in the expected format" X-quisite Windows Software 4 29-11-2010 10:59 AM
ADSI and VB 2008 Error "Cannot Create ActiveX Component" Mysteria Software Development 3 22-05-2009 11:30 AM
"Identifier Expected" error in Dr Java adam.taylor Software Development 5 12-05-2009 11:55 AM
Error "The expected version of the product was not found on your system" Domi.nick Office Update Service 2 08-12-2005 05:03 PM


All times are GMT +5.5. The time now is 05:19 AM.