Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    [VB.net] - Passare un array tramite soap e un web service

    Ragazzi, non riesco a passare un array tramite soap ad un client!
    il webservice mi restituisce sempre lo stesso errore ma non so di cosa si tratta di preciso!

    L errore e questo:

    codice:
    È necessario implementare una funzione di accesso predefinita su System.Array, poiché eredita da ICollection. 
    Descrizione: Eccezione non gestita durante l'esecuzione della richiesta Web corrente. Per ulteriori informazioni sull'errore e sul suo punto di origine nel codice, vedere l'analisi dello stack. 
    
    Dettagli eccezione: System.InvalidOperationException: È necessario implementare una funzione di accesso predefinita su System.Array, poiché eredita da ICollection.
    
    Errore nel codice sorgente: 
    
    Durante l'esecuzione della richiesta Web corrente è stata generata un'eccezione non gestita. Per informazioni sull'origine e la posizione dell'eccezione, vedere l'analisi dello stack dell'eccezione riportata di seguito.  
    
    Analisi dello stack: 
    
    
    [InvalidOperationException: È necessario implementare una funzione di accesso predefinita su System.Array, poiché eredita da 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: Errore nella reflection di 'AutenticazioneResult'.]
       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: Impossibile eseguire la riflessione del metodo srvLogin.Autenticazione.]
       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: Impossibile gestire la richiesta.]
       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: Impossibile gestire la richiesta.]
       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) +699
       System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +95
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +173
     
    Informazioni di versione: Versione di Microsoft .NET Framework:1.1.4322.573; Versione di ASP.NET:1.1.4322.573
    mi potete aiutare?

  2. #2
    Moderatore di Programmazione L'avatar di alka
    Registrato dal
    Oct 2001
    residenza
    Reggio Emilia
    Messaggi
    24,463

    Re: [VB.net] - Passare un array tramite soap e un web service

    Originariamente inviato da ngs
    Ragazzi, non riesco a passare un array tramite soap ad un client! [...]
    mi potete aiutare?
    Non sono così certo che sia possibile passare un Array come valore di ritorno di un WebService: solo le classi che sono "serializzabili" (implementano ISerializable) possono essere restituite, cioè quelle classi che sono in grado di fornire una rappresentazione di se stesse nel formato XML.

    Il DataSet (System.Data), ad esempio, può essere restituito in quanto implementa ISerializable.

    Inoltre, nel caso in esame si dovrebbe anche controllare a quale tipo di dato (classe) appartengono gli oggetti memorizzati nell'array.

    Ciao!
    MARCO BREVEGLIERI
    Software and Web Developer, Teacher and Consultant

    Home | Blog | Delphi Podcast | Twitch | Altro...

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.