views:

267

answers:

2

I've been supplied a web service by a colleague that I tested by creating a quick .net3.5 project. the service exposes a simple method that returns a DataTable and everything works just fine.

The production project is .net1.1, though, and I get a runtime error on the line that creates the web service object:


The XML element '' from namespace 'web/InternetData' is already present in the current scope. Use XML attributes to specify another XML name or namespace for the element.

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: The XML element '' from namespace 'web/InternetData' is already present in the current scope. Use XML attributes to specify another XML name or namespace for the element.

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: The XML element '' from namespace 'http://web/InternetData' is already present in the current scope. Use XML attributes to specify another XML name or namespace for the element.] System.Xml.Serialization.XmlReflectionImporter.AddUniqueAccessor(INameScope scope, Accessor accessor) +866695 System.Xml.Serialization.XmlReflectionImporter.AddUniqueAccessor(MemberMapping member, INameScope elements, INameScope attributes, Boolean isSequence) +84 System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter) +1553

[InvalidOperationException: There was an error reflecting 'AccountNumberResult'.] System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(XmlReflectionMember[] xmlReflectionMembers, String ns, Boolean hasWrapperElement, Boolean rpc, Boolean openModel, RecursionLimiter limiter) +843 System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(String elementName, String ns, XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean rpc, Boolean openModel, XmlMappingAccess access) +130 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) +223 System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs) +2989

[InvalidOperationException: Method Service.CashieringSupport_By_AccountNumber can not be reflected.]


My first thought is to create a separate 2.0 project that dumps the data to be re-consumed by the 1.1 project, but this seems like an unnecessary step.

Any suggestions greatly appreciated!

A: 

Web Services are meant to be platform independent - unless you do something to make them platform dependent. Something like returning data that is platform-dependent. Something like a DataTable.

John Saunders
That's a good point. The return type seems to be what can't be parsed by my 1.1 app. I ended up writing a data dump in 2.0 that is then gobbled up by the 1.1 app. Not ideal, but it works.
John