Serialization Question

From: CJ Taylor (jjackson_at_jackson5.com)
Date: 11/16/04


Date: Tue, 16 Nov 2004 10:31:25 -0600

hey everyone, thought I would ask this here because the web service groups
seems pretty light on conversation. I'm buliding a web service, but keep
getting this error. I understand the error, read a work around, but don't
know if its the best approach.

Here is a link to the error... at least a description.

http://support.microsoft.com/default.aspx?scid=kb;en-us;814187

i'm confused though. I looked at Icollection, and there is no Add Method.
So don't know what to do here. I thought I would inherit from
nameobjectbase and then override the Add method but there is no add to
override.

Suggestions?

here is a complete stack dump of the error.

------------------------------
You must implement the Add(System.String) method on
System.Collections.Specialized.NameValueCollection because it inherits from
ICollection.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: You must implement the
Add(System.String) method on
System.Collections.Specialized.NameValueCollection because it inherits from
ICollection.

Source Error:

      An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: You must implement the Add(System.String) method
on System.Collections.Specialized.NameValueCollection because it inherits
from ICollection.]
   System.Xml.Serialization.TypeScope.GetCollectionElementType(Type type)
   System.Xml.Serialization.TypeScope.ImportTypeDesc(Type type, Boolean
canBePrimitive, MemberInfo memberInfo)
   System.Xml.Serialization.TypeScope.GetTypeDesc(Type type, MemberInfo
source, Boolean directReference)
   System.Xml.Serialization.TypeScope.GetTypeDesc(Type type)
   System.Xml.Serialization.XmlReflectionImporter.ImportMemberMapping(XmlReflectionMember
xmlReflectionMember, String ns, XmlReflectionMember[] xmlReflectionMembers)
   System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(XmlReflectionMember[]
xmlReflectionMembers, String ns, Boolean hasWrapperElement)

[InvalidOperationException: There was an error reflecting
'pCustomAttributes'.]
   System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(XmlReflectionMember[]
xmlReflectionMembers, String ns, Boolean hasWrapperElement)
   System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(String
elementName, String ns, XmlReflectionMember[] members, Boolean
hasWrapperElement)
   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)
   System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo
methodInfo, Boolean client, XmlReflectionImporter xmlImporter,
SoapReflectionImporter soapImporter, String defaultNs)

[InvalidOperationException: Method EMSScoreCardConnectivity.AddDealerTactic
can not be reflected.]
   System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo
methodInfo, Boolean client, XmlReflectionImporter xmlImporter,
SoapReflectionImporter soapImporter, String defaultNs)
   System.Web.Services.Description.SoapProtocolReflector.ReflectMethod()
   System.Web.Services.Description.ProtocolReflector.ReflectBinding(ReflectedBinding
reflectedBinding)
   System.Web.Services.Description.ProtocolReflector.Reflect()
   System.Web.Services.Description.ServiceDescriptionReflector.ReflectInternal(ProtocolReflector[]
reflectors)
   System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type
type, String url)
   System.Web.Services.Protocols.DocumentationServerType..ctor(Type type,
String uri)
   System.Web.Services.Protocols.DocumentationServerProtocol.Initialize()
   System.Web.Services.Protocols.ServerProtocol.SetContext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
   System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)

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

[InvalidOperationException: Failed to handle request.]
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response)
   System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext
context, String verb, String url, String filePath)
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig)
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573



Relevant Pages

  • RE: Problem with webservice returning an array (You must implement a default accessor on System.Arra
    ... \par Public Function GetTitlesForBin(ByVal BinNum as String) as String ... \par System.Xml.Serialization.TypeScope.ImportTypeDesc(Type type, Boolean ... \par xmlReflectionMember, String ns, XmlReflectionMemberxmlReflectionMembers) ... \par HttpContext context, HttpRequest request, HttpResponse response, Boolean& ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Add Web Reference Error
    ... > System.Xml.Serialization.TypeScope.ImportTypeDesc(Type type, Boolean ... > xmlReflectionMember, String ns, XmlReflectionMember ... > HttpContext context, HttpRequest request, HttpResponse response, Boolean& ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Problem with webservice returning an array (You must implement a d
    ... >> Public Function GetTitlesForBin(ByVal BinNum As String) As Array ... >> System.Xml.Serialization.TypeScope.ImportTypeDesc(Type type, Boolean ... >> HttpContext context, HttpRequest request, HttpResponse response, Boolean& ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: Problem with webservice returning an array (You must implement a d
    ... > Public Function GetTitlesForBin(ByVal BinNum As String) As Array ... > System.Xml.Serialization.TypeScope.ImportTypeDesc(Type type, Boolean ... > xmlReflectionMember, String ns, XmlReflectionMemberxmlReflectionMembers) ... > HttpContext context, HttpRequest request, HttpResponse response, Boolean& ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: The namespace, , is a duplicate error when compiling .NET Webservice
    ... the current web request. ... mapping, String ns, Boolean isAny, XmlSchemaElement element) +762724 ... type, HttpContext context, HttpRequest request, HttpResponse response, ...
    (microsoft.public.dotnet.framework.aspnet)