Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2006

Tip: Looking for answers? Try searching our database.

Using Queue as a parameter in a web-service?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Willy S - 31 May 2006 14:05 GMT
Trying to use Queue as a parameter in a web-service I get this error:

You must implement a default accessor on System.Collections.Queue because it
inherits from ICollection.

Is it somehow possible to use Queue as parameter(s) in web-services?

[InvalidOperationException: You must implement a default accessor on
System.Collections.Queue because it inherits from ICollection.]
  System.Xml.Serialization.TypeScope.GetDefaultIndexer(Type type, String
memberInfo) +834165
  System.Xml.Serialization.TypeScope.ImportTypeDesc(Type type, MemberInfo
memberInfo, Boolean directReference) +860
  System.Xml.Serialization.TypeScope.GetTypeDesc(Type type, MemberInfo
source, Boolean directReference, Boolean throwOnError) +150
 
System.Xml.Serialization.XmlReflectionImporter.ImportMemberMapping(XmlReflectionMember
xmlReflectionMember, String ns, XmlReflectionMember[] xmlReflectionMembers,
Boolean rpc, Boolean openModel) +78
 
System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(XmlReflectionMember[]
xmlReflectionMembers, String ns, Boolean hasWrapperElement, Boolean rpc,
Boolean openModel) +278

[InvalidOperationException: There was an error reflecting 'qol'.]
 
System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(XmlReflectionMember[]
xmlReflectionMembers, String ns, Boolean hasWrapperElement, Boolean rpc,
Boolean openModel) +877
 
System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(String
elementName, String ns, XmlReflectionMember[] members, Boolean
hasWrapperElement, Boolean rpc, Boolean openModel, XmlMappingAccess access)
+111
 
System.Web.Services.Protocols.SoapReflector.ImportMembersMapping(XmlReflectionImporter
xmlImporter, SoapReflectionImporter soapImporter, Boolean
serviceDefaultIsEncoded, Boolean rpc, SoapBindingUse use, SoapParameterStyle
paramStyle, String elementName, String elementNamespace, Boolean nsIsDefault,
XmlReflectionMember[] members, Boolean validate, Boolean openModel, String
key, Boolean writeAccess) +203
 
System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo
methodInfo, Boolean client, XmlReflectionImporter xmlImporter,
SoapReflectionImporter soapImporter, String defaultNs) +2460

[InvalidOperationException: Method VosOrdreService.VosRegistrerOrdre can not
be reflected.]
 
System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo
methodInfo, Boolean client, XmlReflectionImporter xmlImporter,
SoapReflectionImporter soapImporter, String defaultNs) +6904
  System.Web.Services.Description.SoapProtocolReflector.ReflectMethod() +133
 
System.Web.Services.Description.ProtocolReflector.ReflectBinding(ReflectedBinding reflectedBinding) +2760
  System.Web.Services.Description.ProtocolReflector.Reflect() +739
 
System.Web.Services.Description.ServiceDescriptionReflector.ReflectInternal(ProtocolReflector[] reflectors) +621
  System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type
type, String url) +117
  System.Web.Services.Protocols.DocumentationServerType..ctor(Type type,
String uri) +159
  System.Web.Services.Protocols.DocumentationServerProtocol.Initialize() +336
  System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing) +99

[InvalidOperationException: Unable to handle request.]
  System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing) +258
 
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response) +90

[InvalidOperationException: Failed to handle request.]
 
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response) +237
 
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext
context, String verb, String url, String filePath) +104
  System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
+175
 
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +120
  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +155
Gaurav Vaish (www.EduJini.IN) - 31 May 2006 19:11 GMT
> You must implement a default accessor on System.Collections.Queue because
> it
> inherits from ICollection.
>
> Is it somehow possible to use Queue as parameter(s) in web-services?

Because the ICollection is read-only.
There are two options:

1. Use a class that implements IList (with Add method)
2. Use an array of items instead of Queue.

Infact, I just finished writing on how arrays can be used in Web Services.
   http://webservices.edujini.in/2006/05/howto-using-arrays-in-webservices.html

Signature

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://webservices.edujini.in
-------------------


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.