2009-09-30 2 views
0

J'ai reçu un service Web d'un collègue que j'ai testé en créant un rapide projet .net 3.5 . le service expose une méthode simple qui renvoie un DataTable et tout fonctionne très bien.(ne sont pas des services Web indépendants de la plate-forme?) Le service Web fonctionne dans les projets .net 2.0+, mais pas .net 1.1

Le projet de production est .Net 1.1, bien que, et je reçois une erreur d'exécution sur la ligne qui crée l'objet de service Web:


 
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.] 

Ma première pensée est de créer un projet 2.0 séparé qui récupère les données à réutiliser par le projet 1.1, mais cela semble être une étape inutile.

Répondre

1

Les services Web sont conçus pour être indépendants de la plate-forme, sauf si vous faites quelque chose pour les rendre dépendants de la plate-forme. Quelque chose comme le retour de données dépendant de la plateforme. Quelque chose comme un DataTable.

+0

C'est un bon point. Le type de retour semble être ce qui ne peut pas être analysé par mon application 1.1. J'ai fini par écrire un vidage de données en 2.0 qui est ensuite englouti par l'application 1.1. Pas idéal, mais ça marche. – John

Questions connexes